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.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- 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
- 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.
- Open the Command Palette and run Chat: Open Worktree Cleanup.
- Choose an inactivity filter of 7, 15, 30, 60, or 90 days. These are available filter choices, not recommended retention periods.
- Review the estimated size for each listed worktree and deselect any you want to keep.
- 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.
Rank #3
- 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
- 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.
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.
Best Value
- [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
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.




