feat(git): let users choose the worktree branch prefix - #8082
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e2c3e50. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new settings workflow and changes how generated worktree branches are renamed, including persisted server configuration and custom Git prefixes. The scope is focused and backwards-compatible, but the user-visible Git behavior warrants human review. You can add or adjust custom eligibility rules. Learn more. |
|
For my example of #6428, do you have thoughts on allowing full branch name customization at worktree creation rather than just the prefix instead? Where as if you gave people the option to just fully customize the branch name on worktree creation, they can then have whatever they want and everyone wins |

Generated worktree branches always start with
t3code/, which conflicts with personal and team branch conventions.Add a server-owned Worktree branch prefix setting under Settings > General. It defaults to
t3code, accepts validated custom prefixes, and can be cleared to create branches without a prefix. Temporary branches stay unchanged, and the server applies the prefix when it generates the final branch name for web, desktop, mobile, and remote clients.Inspired by and with thanks to:
Verified with 116 focused tests, targeted lint, and scoped typechecks for contracts, shared, client runtime, server, web, and mobile.
Model: GPT-5.6 Sol
Harness: Codex in T3 Code
Note
Medium Risk
Touches git branch naming and persisted server settings. Invalid prefixes are schema-validated, but misconfigured prefixes still change how worktrees are renamed for all clients.
Overview
Users can now set a Worktree branch prefix in Settings > General. Generated worktree names still default to
t3code/…, but a custom prefix (including nested paths liketeams/platform) is applied server-side, and clearing the field creates unprefixed branches.buildGeneratedWorktreeBranchNamestrips a leftovert3code/from the model output when it is not the configured prefix, then sanitizes the remainder. Temporary worktree branches are unchanged.The new
worktreeBranchPrefixsetting is validated (lowercase, max 64, no//or leading/trailing separators) and wired through dirty/reset/search plus user docs.Reviewed by Cursor Bugbot for commit 5e5ed3f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add configurable
worktreeBranchPrefixsetting defaulting tot3codeworktreeBranchPrefixfield toServerSettings, defaulting tot3codeand validated by the newWorktreeBranchPrefixschema (max 64 chars, lowercase alphanumerics, no adjacent slashes).buildGeneratedWorktreeBranchNamein ProviderCommandReactor.ts to accept aprefixargument and sanitize it viasanitizeBranchFragment.buildGeneratedWorktreeBranchNamenow requires aprefixparameter; existing callers must be updated.Macroscope summarized 5e5ed3f.