Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

How to Configure VS Code Agent Session Cleanup and Storage Settings

Learn how VS Code separates worktree cleanup, session deletion, automatic merged-session retention, and Copilot session sync—and which setting controls each.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

VS Code has separate controls for cleaning up local agent worktrees, automatically marking or deleting merged sessions, and syncing Copilot session history to GitHub.com. Choose the setting that matches what you want: removing a worktree does not necessarily delete session history, and turning off sync does not erase data already synced.

Know what each cleanup control affects

  • Archive or mark done: removes a session from active lists while retaining its history.
  • Worktree cleanup: removes storage used by eligible local Git worktrees; it does not mean cloud session data has been deleted.
  • Delete a session: permanently removes that session. Commit or integrate any unique worktree changes first.
  • Session sync: controls whether Copilot session history is kept in sync with GitHub.com. Disabling sync affects future syncing, not existing cloud copies.

VS Code’s controls and labels are documented in Microsoft’s Manage agent sessions and Sync and query session history guides. Agent-session features labeled experimental or preview may change.

Review and clean up worktrees manually

  1. Open the Command Palette and run Chat: Open Worktree Cleanup.
  2. Choose an inactivity threshold: 7, 15, 30, 60, or 90 days.
  3. Review the estimated worktree sizes and deselect any worktrees you want to keep.
  4. Confirm cleanup for the selected items.

The cleanup view excludes active, running, waiting-for-input, pinned, done, archived, untitled, and error-state sessions, as well as recent sessions and worktrees whose size cannot be measured. Cleanup marks the selected sessions done and schedules worktree removal. VS Code attempts to commit uncommitted changes to the session branch first; if it cannot preserve changes or remove a worktree, it leaves that worktree in place. Session and branch history remain, and restoring a session recreates its worktree.

Enable worktree storage suggestions

To opt in, add this setting to User or Profile Settings:

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.
"chat.agentSessions.sessionStorageCleanupSuggestion.enabled": true

The setting is experimental and its documented default is false, although experiments can override the default. A suggestion appears when inactive worktrees use at least 5 GiB or when 20 worktrees are eligible. Dismissing a suggestion hides it for the current window. To stop future suggestions, choose Don’t Show Again or run Chat: Disable Session Storage Cleanup Suggestions. See Microsoft’s AI settings reference for the setting details.

Automatically mark and delete eligible merged sessions

These settings are in preview and disabled by default. Microsoft documents 15 days as the recommended value for each stage; adjust them to fit your review and retention needs:

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.
"chat.agentSessions.autoMarkAsDoneMergedSessionsAfterDays": 15,
"chat.agentSessions.autoDeleteMarkedAsDoneMergedSessionsAfterDays": 15
  • chat.agentSessions.autoMarkAsDoneMergedSessionsAfterDays sets how many inactive days pass before an eligible session is automatically marked done.
  • chat.agentSessions.autoDeleteMarkedAsDoneMergedSessionsAfterDays sets the additional delay after automatic marking before permanent deletion.

A value of 0 disables that stage. When either setting is enabled, VS Code checks at startup and hourly. A session must be inactive beyond the applicable threshold, have at least one merged pull request, and have no related open pull requests. External sessions are excluded.

Automatic deletion applies only to sessions VS Code automatically marked done; sessions you mark done manually are not automatically deleted. Restoring an automatically completed session clears its deletion eligibility. Worktree removal is also guarded: the branch must track an upstream and have no outgoing commits or uncommitted changes. If Git state is unknown or conditions are unsafe, VS Code retains the worktree; cleanup does not force-remove it.

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.

Keep Copilot session history local or remove synced data

Stop future syncing

Set this in User or Profile Settings to keep future session data local:

"chat.sessionSync.enabled": false

To exclude specific repositories while leaving sync enabled generally, use exact owner/repo names or glob patterns:

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.
"chat.sessionSync.excludeRepositories": [
  "my-org/private-repo",
  "my-org/secret-*"
]

Copilot Business and Enterprise users may also be subject to GitHub.com enterprise or organization policy, or VS Code CopilotSessionSync group policy. If policy disables sync, the setting is forced off and users cannot override it.

Delete data already synced

Turning off sync does not delete existing synced sessions. To remove them, run Delete Session Sync Data (github.copilot.sessionSync.deleteSessions), select the sessions, and choose either Delete from local and cloud or Delete from cloud only. Deleting from local and cloud is irreversible. Microsoft’s session history guide describes these options.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the control that fits your goal

Goal Use What it does not do
Hide old sessions but retain their history Archive or mark done Does not permanently delete the session.
Review local worktree storage candidates Chat: Open Worktree Cleanup Does not delete synced cloud copies.
Automate retention for qualifying merged sessions The two merged-session settings Does not apply to manually marked-done sessions or external sessions.
Keep future Copilot session history local chat.sessionSync.enabled set to false Does not remove existing cloud data.
Remove cloud copies already synced Delete Session Sync Data Does not change the sync setting for future sessions.

Before deleting a session, commit or integrate unique changes that exist only in its worktree. The automatic worktree safeguards reduce the risk of removing unpreserved Git changes, but they do not replace checking where your work has been saved.

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

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.