Theo-brainUnofficial. Not affiliated with Theo or t3.gg.
Sign inYou

T3 Code guide

Clean up old worktrees automatically

Source control and worktrees

A worktree is a separate copy of your project's files so agents can work without clashing.

Automatic worktree cleanup removes old worktrees, either on one machine or on all connected environments. Policies are off by default and run on the server at startup and when changed.

T3 Code docs: faqproject settings

What it’s for

Reclaiming disk space, since worktrees add up fast; one user cleared 500 GB.

T3 Code docs: faq

When to use it

Use it to reclaim storage, since worktrees add up fast.

T3 Code docs: faq

How to use it

  1. In Settings → Worktrees → Cleanup, turn on automatic worktree cleanup for one machine or all connected environments.

    T3 Code docs: project settingsfaq

  2. Choose when worktrees are removed: after a number of inactive days, after a thread settles, or after merging.

    T3 Code docs: project settings

  3. To clean up right away, run cleanup now from the same section.

    T3 Code docs: faq

What’s changed

  • Deleting a project preserves its worktree cleanup policy, preventing unintended checkout removal.Updated Nov 14
  • Worktree cleanup preserves worktrees containing nested repositories and their uncommitted files.Updated Nov 13
  • Worktrees of settled threads can now be cleaned up.Updated Oct 15
1 earlier change
  • Automatic storage cleanup can be set per machine and per project.Added Sep 17

Unofficial notes. Not affiliated with Theo or t3.gg.