October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Why VS Code Agent Sessions Use Disk Space—and What They Store

VS Code sessions can retain chat history as well as project files in isolated worktrees. Learn what may be stored and how to review inactive worktrees before cleanup.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

VS Code agent sessions can use disk space in two distinct ways: they retain conversation and session data, and—when run in isolated worktrees—they may leave project files and changes behind. Worktree contents can be a substantial contributor, but Microsoft does not publish a typical size per session or a universal breakdown of how much space each type of data uses.

Why do VS Code agent sessions consume disk space?

An agent session groups work such as chats, a workspace, and code changes. Its storage is not necessarily just a transcript. In worktree-isolated mode, a session can have its own Git working tree containing project files and work performed for that task. Inactive worktrees can accumulate over time; VS Code’s session-management documentation specifically warns that they can use significant disk space.

The amount depends on the session mode, repository, work performed, and provider. The documentation does not give an average size per session or establish that every worktree is a complete duplicate of a repository. Conversation records and indexes also use storage, but the available documentation does not quantify their share relative to worktree files.

What files and data can a session contain?

Storage layer What it can contain What is established
Conversation and tool history Prompts, assistant responses, tool calls, and accumulated context. The exact byte-level format varies; there is no single published schema covering every provider.
Copilot searchable session history Session metadata and conversation turns, plus repository, branch, working directory, timestamps, agent or participant, paths of files touched through tool calls, and external references such as pull requests, issues, and commit SHAs. VS Code documents a local SQLite database for this searchable history. See Sync and query session history.
Local chat-session records Session data written as JSON files and, when enabled, JSONL append logs. The VS Code ChatSessionStore implementation describes these formats. Details may change as the code evolves.
Workspace or worktree Project files and changes made or generated during agent work. An isolated worktree provides a separate working tree; it can remain after a session is marked done if safe cleanup conditions are not met.
Synced session history Copilot history associated with a GitHub account. This is a sync and retention question, separate from the local disk used by a worktree. The history documentation describes sync and deletion controls.

Where are VS Code chat session files stored?

There is no single path that applies to every VS Code session, profile, provider, operating system, or local and remote workspace. VS Code core supports JSON and JSONL session files associated with workspace storage, while Copilot’s searchable session-history feature documents a local SQLite store. These are distinct storage mechanisms, not a guarantee that every session creates all of these files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

A report for VS Code 1.122.0-Insider describes .json and .jsonl files under workspaceStorage/{workspaceId}/chatSessions/ in a particular profile and authentication scenario. In that case, files remained on disk but the session history became undiscoverable after the profile context changed. This issue report is an example, not a portable storage-path instruction: see VS Code issue #318152.

Before trying to locate or remove files manually, identify your VS Code build, operating system, active profile, session provider, and whether the workspace or session is local or remote. The available documentation does not provide a complete, universal file-by-file path map.

Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

How to review and clean up inactive worktrees

Use VS Code’s built-in cleanup editor to inspect eligible worktrees and their estimated sizes before removal.

  1. Open the Command Palette and run Chat: Open Worktree Cleanup.
  2. Choose an inactivity filter of 7, 15, 30, 60, or 90 days. These are available filter choices, not recommended retention periods.
  3. Review the estimated size for each listed worktree and deselect any you want to keep.
  4. Confirm removal only after checking that you do not need the worktree’s uncommitted changes.

The cleanup editor excludes worktrees that are active, running, waiting for input, pinned, done, archived, untitled, in an error state, too recent for the chosen filter, or too difficult to measure. So it is a tool for reviewing eligible inactive worktrees, not a complete meter of all disk use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

When cleaning up, VS Code attempts to commit uncommitted changes to the session branch before removing a worktree. If it cannot preserve changes or safely remove the worktree, it leaves it in place. Automatic cleanup of merged sessions also depends on safe Git conditions and does not force removal. Review or preserve valuable work before asking VS Code to delete a session; deletion is permanent, and removal of associated worktrees is subject to shared-worktree and cleanup rules. The session-management documentation explains these behaviors.

What does the cleanup suggestion threshold mean?

The experimental suggestion setting is chat.agentSessions.sessionStorageCleanupSuggestion.enabled. It is off by default. When enabled, VS Code can suggest cleanup if inactive worktrees use at least 5 GiB or if 20 worktrees are eligible for cleanup, according to the AI settings reference. These are alternative suggestion triggers—not a typical session-size estimate, a full disk-usage report, or a promise that VS Code automatically deletes worktrees.

Rank #4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
  • Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does archiving or marking a session done free space?

Archiving and marking a session done organize it; neither means the conversation has been deleted. A worktree may remain after either status when safe cleanup requirements are not satisfied. Deleting a session is a separate, permanent action and may remove an associated worktree under the applicable cleanup rules.

Copilot history sync is another separate control. The chat.sessionSync.enabled setting controls session-history sync. The Delete Session Sync Data command offers local-and-cloud deletion or cloud-only deletion. Opting out of sync does not by itself remove existing cloud copies; those must be deleted separately. See Sync and query session history for the documented scopes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
UnionSine 500GB Ultra Slim Portable External Hard Drive HDD-USB 3.0
  • [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
  • 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
  • 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
  • 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.

How sessions, files, and cleanup fit together

For troubleshooting, first distinguish stored conversation history from an isolated worktree. Then inspect eligible worktrees in the cleanup editor rather than deleting a guessed storage folder. Treat sync settings and deletion scope separately from local project files. VS Code’s sessions and chats overview explains how sessions organize agent work.

Quick Recap

SaleBestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.99
Bestseller No. 2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$229.99
Bestseller No. 3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
Bestseller No. 4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$208.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.