Uh oh!
There was an error while loading. Please reload this page.
[Feature]: Per-project worktree location #6975
MrSimmmons
started this conversation in
Ideas
Replies: 0 comments
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/server
Problem or use case
All worktrees T3 Code creates go to a fixed
<T3 home>/worktrees/<repo-name>/<branch>path which breaks a few things for my use-cases, and potentially others as well particually when working on larger shared applications.While there is the
T3CODE_HOME/--home-dir, flag / setting, this relocates all T3 state (sqlite, logs, attachments, secrets) to that new directory which is too blunt of a tool for this case.That fixed location breaks a few things for me:
<repo>.worktrees/folder which mainly comes from VS Code when creating worktrees through its UI, but also other Git clients follow this format as wellProposed solution
A per-project "Worktree location" setting, in Project Settings → Checkout.
<that path>/<branch>. Pointing it at~/code/myrepo.worktreesgives exactly the sibling layout other tools expect.One non-obvious dependency: the review/diff view rejects any cwd outside the workspace root or the default worktrees directory, so that check has to accept configured roots too. Without it, diffs silently break for every worktree in a custom location.
Why this matters
It unblocks anyone whose toolchain is directory-dependent which is most people using nix, direnv, devcontainers, or monorepo tooling. Right now the only realistic answer is "don't use worktree mode" without some annoying workaround
Smallest useful scope
One free-text absolute path per project
Alternatives considered
Risks or tradeoffs
AI generated this section:
git worktree add, so it needs validating: expand~, reject relative paths, and reject at save time rather than failing every new thread later.git worktree addfails loudly on a non-empty directory, so this is visible rather than silent — worth documenting instead of engineering around.git status. Worth a line in the field description; not worth blocking.Examples or references
Related issues: #1878 , #523 (direnv/nix not propagated — location is a precondition).
Prior PRs in this repo around the same underlying issue: PR #4439 (open, global path template), PR #1926 (closed, four-mode version) but IMO with more complexity / blast radius
What I'm running in a fork

Contribution
All reactions