VS Code agent sessions can use disk space in two distinct ways: session records save conversation and tool history, while an isolated session worktree holds project files and changes. Worktrees can become the larger contributor when multiple inactive sessions retain project data, but VS Code does not publish a typical size per session or a universal breakdown of storage by category.
Why VS Code agent sessions consume disk space
A session groups agent work, such as chats, a workspace, and code changes. If you use an isolated worktree, the session also has its own working tree. VS Code warns that worktree-isolated agent sessions can accumulate and use significant disk space. The amount depends on the repository, session mode, work performed, and provider; documentation does not establish that every worktree is a full repository duplicate.
Conversation records and indexes also take storage, but VS Code does not quantify their share relative to project files. A session may therefore involve both saved history and a worktree, rather than one file or one transcript accounting for all its disk use.
What files and data a session can contain
| Storage layer | What it may contain | What is established |
|---|---|---|
| Conversation and tool history | Prompts, agent responses, tool calls, and accumulated context. | The exact byte-level schema is not published for all providers. |
| Copilot searchable history | Session metadata, conversation turns, repository and branch details, working directory, timestamps, agent or participant, file paths from tool calls, and external references such as pull requests, issues, and commit SHAs. | VS Code documents a local SQLite database for this feature. See Sync and query session history. |
| Core local chat-session storage | Session files, with JSON and, when enabled, JSONL append logs described in VS Code’s implementation. | This implementation detail can change. The source is the ChatSessionStore implementation. |
| Workspace or isolated worktree | Project files and changes or generated files from agent work. | Worktree contents depend on the repository and work performed; these files are separate from conversation records. |
| Synced session history | Copilot session history associated with a GitHub account. | Sync is separate from local worktree storage. See Sync and query session history. |
There is no single portable path that covers every VS Code build, profile, provider, and local or remote workspace. A report for VS Code 1.122.0-Insider describes .json and .jsonl files under workspaceStorage/{workspaceId}/chatSessions/ in a particular profile and authentication case; after profile context changed, the files remained but the history was no longer discoverable. That issue is a case report, not a universal storage rule: VS Code issue #318152.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match#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.
For session terminology, see Understand sessions and chats. To identify a particular storage location safely, first establish the VS Code build, operating system, profile, session provider, and whether the workspace or session is local or remote. Avoid deleting a guessed folder: it may not map to the history you intend to remove.
How to find and clean up inactive worktrees
- 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 sizes shown in the cleanup editor. Deselect any worktrees you want to keep.
- Confirm removal only after checking that you do not need the work or changes in the selected worktrees.
The cleanup editor does not offer every worktree as a removal candidate. It excludes active, running, waiting-for-input, pinned, done, archived, untitled, error-state, too-recent, or unmeasurable worktrees. Estimates are not a complete meter of all VS Code session-related storage.
Rank #2
- MADE FOR THE MAKERS: Create; Explore; Store; The T7 Portable SSD delivers fast speeds and durable features to back up any endeavor; Build your video editing empire, file your photographs or back up your blogs all in an instant
- SHARE IDEAS IN A FLASH: Don’t waste a second waiting and spend more time doing; The T7 is embedded with PCIe NVMe technology that brings fast read and write speeds up to 1,050/1,000 MB/s¹, making it almost twice as fast as the T5
- ALWAYS MAKE THE SAVE: Compact design with massive capacity; With capacities up to 4TB, save exactly what you need to your drive – from large working files to game data and everything in between
- ADAPTS TO EVERY NEED: Whether using a PC or mobile phone, count on the T7 for extensive compatibility²; It’s a true team player when it comes to heavy-duty application usage or file-saving
- HI RESOLUTION VIDEO RECORDING: Record Ultra High Resolution (4K 60fs) videos directly onto the T7 Portable SSD with your favorite camera or mobile devices; Supports iPhone 15 Pro Res 4K at 60fps video and more³
VS Code tries to commit uncommitted changes to the session branch before removing a worktree. If changes cannot be preserved or safe removal conditions are not met, the worktree may remain. Automatic cleanup of merged sessions also depends on safe Git conditions and does not force-remove a worktree. Inspect or preserve uncommitted work before deleting a session.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Cleanup suggestions, archiving, and deletion are different
The experimental cleanup suggestion is off by default. Enable chat.agentSessions.sessionStorageCleanupSuggestion.enabled to use it. According to the AI settings reference, the suggestion can trigger when inactive worktrees use at least 5 GiB or when 20 worktrees are eligible for cleanup. These are suggestion thresholds, not a typical session size, a complete disk-usage measurement, or a promise of automatic deletion.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #3
- MADE FOR THE MAKERS: Create; Explore; Store; The T7 Portable SSD delivers fast speeds and durable features to back up any endeavor; Build your video editing empire, file your photographs or back up your blogs all in an instant
- SHARE IDEAS IN A FLASH: Don’t waste a second waiting and spend more time doing; The T7 is embedded with PCIe NVMe technology that brings fast read and write speeds up to 1,050/1,000 MB/s¹, making it almost twice as fast as the T5
- ALWAYS MAKE THE SAVE: Compact design with massive capacity; With capacities up to 4TB, save exactly what you need to your drive – from large working files to game data and everything in between
- ADAPTS TO EVERY NEED: Whether using a PC or mobile phone, count on the T7 for extensive compatibility²; It’s a true team player when it comes to heavy-duty application usage or file-saving
- HI RESOLUTION VIDEO RECORDING: Record Ultra High Resolution (4K 60fs) videos directly onto the T7 Portable SSD with your favorite camera or mobile devices; Supports iPhone 15 Pro Res 4K at 60fps video and more³
- Archive or mark done: organizes a session; it is not the same as deleting its conversation or removing its worktree.
- Clean up a worktree: removes eligible worktree files when safe conditions allow; it does not mean every kind of session history has been deleted.
- Delete a session: permanent. Supported Copilot deletion can remove associated worktrees, subject to shared-worktree and cleanup rules.
- Delete synced history: a separate choice for Copilot session history. The
chat.sessionSync.enabledsetting controls sync, and the Delete Session Sync Data command offers local-and-cloud or cloud-only deletion. Turning sync off does not delete existing cloud copies; delete those separately if that is what you intend.
See Manage agent sessions in VS Code for worktree cleanup and deletion behavior, and Sync and query session history for sync and deletion scopes.
Quick Recap
Best Value
- Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
- Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
- Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
- Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
- Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C
Rank #4
- Note: Magsafe is not available in this version
- High-speed Data Transfer: Lexar external SSD ES3 supports USB 3.2 Gen 2 up to 1050MB/s read and 1000MB/s write to transfer files fast for more efficient work. (Performance may be lower if not supporting USB 3.2 Gen 2 on Mac and other systems)
- Wide Compatibility: Lexar Portable SSD ES3 compatibility with iPhone 17 series (Not supported on iPhone 14 and older models), Android mobile devices, laptops, cameras, Xbox X|S, PS4, PS5, gaming console, and more
- On The Go: Lexar external solid state drive ES3's thin, stylish, and durable design, weighs 42g and is only 10.5mm thick, making it smaller than a card and easily fits in your pocket. It comes with a Type-C cable for plug-and-play convenience
- Data Safety First: Lexar SSD ES3 includes Lexar DataShieldTM 256-bit AES encryption software to protect files
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.

