Uh oh!
There was an error while loading. Please reload this page.
add configurable worktree location settings - #1926
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs human review This PR introduces a new feature (configurable worktree locations) with substantial new code across services, shared utilities, UI components, and settings schema. New user-facing capabilities and runtime behavior changes warrant human review. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c34be34. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
fredericmorin-flare
commented
Jun 2, 2026
bump! would love to have that feature. currently blocked from using t3code on a project that requires worktree to be in a specific location for some other integration to work. |
tarik02
commented
Jun 2, 2026
@fredericmorin-flare actually you can create worktrees on your own and they become available in t3code branch picker pretty good workaround |
juliusmarminge
commented
Jul 20, 2026
Closing after product review: configurable worktree location is not planned in this form against the current workspace lifecycle. |

Fixes#1878
What Changed
This adds configurable worktree location settings so T3 Code does not have to create worktrees in one fixed global layout.
Specifically, this PR:
Why
Some projects depend on folder-scoped local tooling and parent-directory configuration.
Examples from the issue include setups like
direnv, flakes, and similar tooling that only work when the worktree lives under the expected project directory tree. The current global worktree location breaks those setups because the new worktree ends up outside the folder hierarchy those tools rely on.This change lets users keep the existing global behavior, place worktrees under the project, or define a custom layout when their environment has stricter path requirements.
UI Changes
Before:
After:
Worktree locationsetting_20260411_131122.webm
Checklist
Note
Medium Risk
Changes where worktrees are created on disk (filesystem layout) and threads on paths that depend on project-adjacent tooling; invalid templates fail worktree creation explicitly rather than silently using the old default.
Overview
Adds configurable worktree paths so server-driven worktree creation (new worktree threads, PR worktree prep, and
createWorktreewithout an explicit path) no longer always uses Git’s default layout.Server: Introduces
WorktreeLocationResolver, wired intoGitManagerandGitWorkflowService, which readsworktreeLocationfrom server settings and resolves a path beforegit worktree add. Invalid custom templates surface asWorktreeLocationResolverError(also included in git manager / VCS create-worktree error unions).Contracts & shared:
ServerSettingsgainsworktreeLocation(mode+template); sharedworktreeLocationhelpers handle template validation, variable substitution ($T3_HOME,$PROJECT_DIRNAME,$PROJECT_NAME,$WORKTREE_NAME), resolution for default / project-subdirectory / project-sibling / custom modes, and previews.UI: General Settings adds a Worktree location control (mode selector, custom template field with variable hints, live preview, validation) and includes it in restore-defaults.
Tests: Coverage for shared resolution, resolver layers in git/server tests, and updated expectations when paths are auto-resolved (e.g. mock
.mock-worktrees/...in tests).Reviewed by Cursor Bugbot for commit 49b653e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add configurable worktree location settings with UI controls and live preview
WorktreeLocationResolverservice that resolves where git worktrees are created, supporting four modes: default, project-subdirectory, project-sibling, and custom template.worktreeLocation(mode + template) toServerSettingswith defaults, patch support, and a newWorktreeLocationResolverErrorerror type in contracts.GitManagerandGitWorkflowServiceso worktrees are created at the resolved path instead of an unspecified location.GeneralSettingsPanelwith a mode selector, optional custom template input, variable chips, and a live preview/validation message.createWorktreeandpreparePullRequestThreadnow use a resolved path rather thannull; theWsVcsCreateWorktreeRpcRPC may now fail withWorktreeLocationResolverErrorin addition toGitCommandError.Macroscope summarized 49b653e.