Start by finding which folders are using your storage. If inactive AI-agent worktrees are the cause, VS Code’s built-in cleanup tool can remove selected worktrees while preserving session branch history. If your system drive is too small, you can move VS Code-managed data to another location—but relocation changes where files are stored, not how much storage VS Code can use.
Disk space is separate from AI context, tokens, or credits. Context concerns conversation inputs and workspace files; VS Code specifically identifies accumulating worktrees as a potential disk-space issue.
As an Amazon Associate I earn from qualifying purchases.
Find what is using the disk before cleaning up
Check your operating system’s storage settings or use a trusted disk-usage view to identify the largest directories. Then inspect VS Code’s agent worktrees with its cleanup editor. This helps distinguish a confirmed storage problem from assumptions about AI use: the documentation identifies worktrees as files that can accumulate, but does not establish that long prompts or a large context window alone fill a drive.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Review and clean up inactive agent worktrees
- Open the Command Palette in VS Code.
- Run Chat: Open Worktree Cleanup.
- Choose an inactivity filter: 7, 15, 30, 60, or 90 days.
- Review the eligible sessions and their estimated sizes, then select only work you no longer need.
VS Code is designed to preserve work during cleanup: it commits uncommitted changes to the session branch before removing a worktree. If it cannot preserve changes or safely remove the worktree, it leaves that worktree in place. Branch history remains, and restoring a session can recreate its worktree.
#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.
This tool targets inactive agent-session worktrees. It is not a general cleaner for extension folders, caches, build outputs, or every file VS Code uses.
Use cleanup suggestions as prompts, not storage limits
To enable an in-product reminder, set chat.agentSessions.sessionStorageCleanupSuggestion.enabled to true. This setting is experimental and disabled by default. Its suggestion may appear when eligible inactive worktrees use at least 5 GiB or when 20 worktrees are eligible. Those are suggestion triggers—not a quota, a prediction of your usage, or a measure of all VS Code 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³
Move VS Code-managed data off a constrained system drive
VS Code provides two ways to choose where its managed data is stored. Portable Mode keeps that data near the application; command-line options let you specify separate user-data and extensions directories. Both change the storage location, not the amount of data created. Portable Mode takes precedence over the command-line directory options.
Portable Mode
For supported Windows ZIP and Linux TAR.GZ distributions, create a folder named data beside the VS Code application. On macOS, create code-portable-data beside the application. VS Code’s documentation also covers moving existing user data and extensions into Portable Mode. Follow its migration guidance rather than simply deleting the originals.
Rank #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³
A portable installation on an external SSD may suit someone who can keep the drive connected and maintain a backup. That is a practical use of the relocation options, not an official VS Code recommendation.
Custom directories
Launch VS Code with --user-data-dir <dir> to choose a user-data directory, or --extensions-dir <dir> to choose an extensions directory. These options can be used independently. If Portable Mode is enabled, it overrides them.
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
Choose the remedy that matches the cause
| Option | Best for | Effect on files | Active-work risk and upkeep |
|---|---|---|---|
| Worktree cleanup | Inactive agent worktrees are confirmed to be taking space. | Removes selected inactive worktrees while preserving session branch history; it does not clean unrelated VS Code storage. | Designed to preserve uncommitted changes and leave a worktree if preservation or removal fails. Review sessions before selecting them. |
| Portable Mode or custom directories | The system drive is constrained and you want VS Code-managed data stored elsewhere. | Relocates storage; it does not delete data or limit future growth. | The destination must remain available. Keep a backup and monitor the new location. |
Understand session history, sync, and local files
VS Code documents Copilot session history as searchable and stored in a local SQLite database. Session sync is on by default in the cited documentation. Setting chat.sessionSync.enabled to false keeps session data local by changing sync behavior; it does not delete existing local data or free disk space by itself.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
For instructions on deleting session history or handling corruption, use the official session-history documentation. Avoid manually removing undocumented database files.
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
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.




