Skip to content

Worktree cleanup

Remove a task worktree after its branch merges, you abandon it, or you no longer need it. Durable workspaces, such as work or personal contexts, persist after you remove their task worktrees.

Before you delete a task worktree, decide what to do with its work:

  • Commit and push changes you want to keep.
  • Save notes or prompts you want to keep available.
  • Confirm the branch has merged if that was the goal.
  • Confirm you do not need the provider’s session history for follow-up work.

To keep the code, preserve it through Git before you delete the worktree.

If you delete a worktree by mistake, stop cleanup and try the recovery steps in Troubleshooting.

Cleanup removes the worktree and clears Superconductor’s local runtime state for that task branch. Cleanup can also delete the local branch and its remote-tracking branches, depending on your settings.

Superconductor clears related caches so stale diffs, pull request state, setup markers, and session metadata disappear with the worktree.

Projects can define pre-cleanup and post-cleanup commands for repository-specific teardown: stop services, remove generated local files, or run project cleanup around worktree deletion.

If a pre-cleanup hook fails, Superconductor keeps the worktree intact.

Superconductor reports post-cleanup hook failures after it removes the worktree.

Branch cleanup is configurable. Settings control whether cleanup deletes the local task branch, the remote-tracking branches, or both.