You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Safe Exact-Path Worktree Retirement and Restoration on Windows
#37318
I'm requesting a supported, safe, exact-path worktree retirement and restoration process for T3 Code on Windows.
Our development repository accumulated hundreds of T3-managed worktrees. We have successfully retired 77 independently verified worktrees, recovering approximately 19 GiB of disk space.
However, 327 additional worktrees remain classified UNKNOWN because we cannot conclusively verify T3's ownership-release, removal, and restoration guarantees.
We want to preserve every conversation, Git branch, commit, review artifact, and development recovery option while removing unnecessary working directories.
We are not requesting deletion of conversations or forced cleanup.
Our review of the pinned release identified three important limitations.
1. Windows worktree removal
In apps/server/src/vcs/worktreeRemoval.ts, the Windows linked-worktree helper performs safety checks, then recursively removes the directory and invokes:
git worktree remove --force --force
We understand this addresses Windows junction-handling behavior, but our cleanup policy requires native, non-force removal.
2. Automatic restoration
In apps/server/src/workspace/restoreMissingWorktree.ts, restoration invokes pruneWorktrees.
If the original branch is missing, restoration can fall back to another source reference.
We require exact reconstruction of the recorded branch and HEAD, with a clear refusal if that identity cannot be verified.
3. Cleanup selection
T3 documents automatic cleanup policies and manual worktree-deletion prompts.
However, the inspected Delete now operation runs enabled cleanup rules rather than an explicitly selected worktree allowlist.
We cannot enable broad cleanup merely to retire a few approved directories.
Requested Capabilities
1. Exact-Path Selection and Dry Run
Provide a supported interface to select individual worktrees and preview exactly what would be removed.
The operation must not trigger cleanup of unrelated worktrees, browser captures, logs, or evidence.
2. Manager-Coordinated Ownership Release
Before retirement, verify that the worktree has no active or pending agent sessions, terminal processes, queued commands, shared thread owners, workspace leases, or runtime dependencies.
Provide a supported ownership-release mechanism that preserves the conversation.
3. Non-Force Windows Removal
Support removal that preserves Windows junction safeguards without forced Git operations.
Unexpected modifications, locks, or uncertain ownership must cause refusal.
If the current Windows implementation cannot meet these requirements, please clarify whether a product change is necessary.
4. Conversation and Source Preservation
Document whether retirement preserves:
Historical conversation messages and thread identity
Git branches, commits, and references
Attached review evidence
Source links
Ability to reopen historical conversations
Ability to resume development
Please distinguish preserving conversation history from restoring the original workspace.
5. Interrupted Removal Recovery
Provide a supported recovery procedure for failures between filesystem removal and Git registration cleanup.
Recovery should not require manual T3 metadata editing, forced removal, or pruning unrelated worktree registrations.
6. Exact-Source Reconstruction
Allow explicit restoration using the recorded repository, worktree path, branch, and HEAD commit.
If the original branch or commit is unavailable, restoration should refuse rather than silently use another source.
Please also clarify whether restoration reruns worktree-creation setup scripts.
7. Historical and Exceptional Worktrees
Document supported handling for:
Renamed or switched branches
Detached HEAD
Multiple threads sharing one worktree
Unbound worktrees inside T3-managed directories
Thread-bound worktrees outside the managed root
Archived conversations
8. Verification Receipt
Provide a machine-readable or otherwise verifiable receipt identifying:
Once an officially supported procedure is established, we intend to conduct a separately authorized pilot involving three to five inactive, clean, source-preserved worktrees.
We will verify ownership release, conversation continuity, source preservation, exact-path removal, restoration, and Git integrity.
Until then, the affected worktrees remain untouched.
Questions for the Maintainers
Does an existing supported API, CLI, or UI workflow satisfy these requirements?
If not, could an exact-path, dry-run, non-force retirement workflow be supported?
What is the recommended way to preserve thread resumability when retiring managed worktrees?
Can restoration be made strictly source-pinned without shared Git pruning?
Our goal is to reclaim disk space without sacrificing development history or weakening T3 Code's existing safety protections.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
I'm requesting a supported, safe, exact-path worktree retirement and restoration process for T3 Code on Windows.
Our development repository accumulated hundreds of T3-managed worktrees. We have successfully retired 77 independently verified worktrees, recovering approximately 19 GiB of disk space.
However, 327 additional worktrees remain classified UNKNOWN because we cannot conclusively verify T3's ownership-release, removal, and restoration guarantees.
We want to preserve every conversation, Git branch, commit, review artifact, and development recovery option while removing unnecessary working directories.
We are not requesting deletion of conversations or forced cleanup.
Environment
0.1.10-nightly.20261114.4669db2cc2026427c5eb647a08538c12402341db0fabCurrent Implementation Concerns
Our review of the pinned release identified three important limitations.
1. Windows worktree removal
In
apps/server/src/vcs/worktreeRemoval.ts, the Windows linked-worktree helper performs safety checks, then recursively removes the directory and invokes:git worktree remove --force --forceWe understand this addresses Windows junction-handling behavior, but our cleanup policy requires native, non-force removal.
2. Automatic restoration
In
apps/server/src/workspace/restoreMissingWorktree.ts, restoration invokespruneWorktrees.If the original branch is missing, restoration can fall back to another source reference.
We require exact reconstruction of the recorded branch and HEAD, with a clear refusal if that identity cannot be verified.
3. Cleanup selection
T3 documents automatic cleanup policies and manual worktree-deletion prompts.
However, the inspected Delete now operation runs enabled cleanup rules rather than an explicitly selected worktree allowlist.
We cannot enable broad cleanup merely to retire a few approved directories.
Requested Capabilities
1. Exact-Path Selection and Dry Run
Provide a supported interface to select individual worktrees and preview exactly what would be removed.
The operation must not trigger cleanup of unrelated worktrees, browser captures, logs, or evidence.
2. Manager-Coordinated Ownership Release
Before retirement, verify that the worktree has no active or pending agent sessions, terminal processes, queued commands, shared thread owners, workspace leases, or runtime dependencies.
Provide a supported ownership-release mechanism that preserves the conversation.
3. Non-Force Windows Removal
Support removal that preserves Windows junction safeguards without forced Git operations.
Unexpected modifications, locks, or uncertain ownership must cause refusal.
If the current Windows implementation cannot meet these requirements, please clarify whether a product change is necessary.
4. Conversation and Source Preservation
Document whether retirement preserves:
Please distinguish preserving conversation history from restoring the original workspace.
5. Interrupted Removal Recovery
Provide a supported recovery procedure for failures between filesystem removal and Git registration cleanup.
Recovery should not require manual T3 metadata editing, forced removal, or pruning unrelated worktree registrations.
6. Exact-Source Reconstruction
Allow explicit restoration using the recorded repository, worktree path, branch, and HEAD commit.
If the original branch or commit is unavailable, restoration should refuse rather than silently use another source.
Please also clarify whether restoration reruns worktree-creation setup scripts.
7. Historical and Exceptional Worktrees
Document supported handling for:
8. Verification Receipt
Provide a machine-readable or otherwise verifiable receipt identifying:
Related Existing Issues
These reports appear relevant:
This request concerns the combined supported lifecycle rather than replacing those individual reports.
Relevant Source
Release commit:
db2cc2026427c5eb647a08538c12402341db0fabdocs/user/project-settings.mdapps/server/src/vcs/worktreeRemoval.tsapps/web/src/components/settings/StorageSettings.tsxapps/server/src/workspace/restoreMissingWorktree.tsIntended Validation
Once an officially supported procedure is established, we intend to conduct a separately authorized pilot involving three to five inactive, clean, source-preserved worktrees.
We will verify ownership release, conversation continuity, source preservation, exact-path removal, restoration, and Git integrity.
Until then, the affected worktrees remain untouched.
Questions for the Maintainers
Our goal is to reclaim disk space without sacrificing development history or weakening T3 Code's existing safety protections.
All reactions