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
Add a project script hook that runs when T3 deletes a worktree (e.g. runOnWorktreeDelete) #33096
t3.json scripts can run when a worktree is created (runOnWorktreeCreate) and when a thread settles (runOnSettle). Nothing runs when T3 deletes a worktree, although T3 now deletes them automatically (Storage cleanup: worktreeOnDelete, worktreeOnMerge, worktreeAfterDays, worktreeUnchanged).
Per-worktree state that lives outside the worktree directory therefore leaks. In our repo that is direnv's allow entry, plus the Nix GC roots behind .direnv and the dev shell it pins. We also need to stop dev services that were started from the worktree.
runOnSettle is not a substitute. A settled thread resumes in the same worktree, so tearing down the direnv/Nix state there forces a full dev-shell rebuild on every resume.
Prior art
Codex local environments have a [cleanup] script that runs when the worktree is removed, next to [setup]. We use it to run direnv revoke, remove .direnv, and stop dev services, so this is a direct parity gap.
Activity