Problem
The built-in Claude Code EnterWorktree tool — which ~/.claude/CLAUDE.md tells agents to prefer — creates worktrees with its own worktree.baseRef (default fresh = origin/<default-branch> = main). It does not go through wtutils.sh / chamber.config, so it ignores the per-repo default_base.
The wt-add shell path (wtutils.sh) does honor it (wtutils.sh reads default_base ~line 103 and passes it to git worktree add -b … "$base" ~line 267). So the two worktree-creation paths disagree.
Symptom (how it bit us)
In manapool/manabot-alpha, chamber.config declares "default_base": "origin/dev" and feature PRs target dev. But every worktree made via EnterWorktree branched off main. Since main runs ahead of dev by all the dev→main promotion merges, every PR's commit list was polluted with ~25 Merge pull request #N from manapoolinc/dev commits. (File diffs were fine; commit list was noise.) Workaround was git rebase --onto origin/dev $(git merge-base HEAD origin/main) on each branch.
Secondary: the chamber.config post-create hooks (e.g. pnpm install --frozen-lockfile) also don't run for EnterWorktree-created worktrees — deps had to be installed manually each time.
Desired fix
Make EnterWorktree-created worktrees honor chamber.config:
- Base the new branch on the repo's
default_base (e.g. origin/dev) instead of main.
- Run the chamber
hooks (pnpm install, config symlinks) post-create.
Likely approach (investigate): a PostToolUse hook on EnterWorktree (there's already an EnterWorktree|ExitWorktree matcher running worktree-cwd-notify.sh) that, when the new worktree's base ≠ default_base, re-bases it (git reset --hard <default_base> / git rebase --onto) and runs the post-create hooks. worktree.baseRef only supports fresh/head, so it can't target an arbitrary branch directly — hence the post-create reconciliation. Alternatively, reconsider whether the CLAUDE.md guidance should point at wt-add for repos with a non-default integration branch.
Acceptance: EnterWorktree in manabot-alpha produces a branch based on origin/dev (clean PR, 1 commit) with deps installed.
Problem
The built-in Claude Code
EnterWorktreetool — which~/.claude/CLAUDE.mdtells agents to prefer — creates worktrees with its ownworktree.baseRef(defaultfresh=origin/<default-branch>=main). It does not go throughwtutils.sh/chamber.config, so it ignores the per-repodefault_base.The
wt-addshell path (wtutils.sh) does honor it (wtutils.shreadsdefault_base~line 103 and passes it togit worktree add -b … "$base"~line 267). So the two worktree-creation paths disagree.Symptom (how it bit us)
In
manapool/manabot-alpha,chamber.configdeclares"default_base": "origin/dev"and feature PRs targetdev. But every worktree made viaEnterWorktreebranched offmain. Sincemainruns ahead ofdevby all thedev→mainpromotion merges, every PR's commit list was polluted with ~25Merge pull request #N from manapoolinc/devcommits. (File diffs were fine; commit list was noise.) Workaround wasgit rebase --onto origin/dev $(git merge-base HEAD origin/main)on each branch.Secondary: the
chamber.configpost-createhooks(e.g.pnpm install --frozen-lockfile) also don't run forEnterWorktree-created worktrees — deps had to be installed manually each time.Desired fix
Make
EnterWorktree-created worktrees honorchamber.config:default_base(e.g.origin/dev) instead ofmain.hooks(pnpm install, config symlinks) post-create.Likely approach (investigate): a
PostToolUsehook onEnterWorktree(there's already anEnterWorktree|ExitWorktreematcher runningworktree-cwd-notify.sh) that, when the new worktree's base ≠default_base, re-bases it (git reset --hard <default_base>/git rebase --onto) and runs the post-create hooks.worktree.baseRefonly supportsfresh/head, so it can't target an arbitrary branch directly — hence the post-create reconciliation. Alternatively, reconsider whether the CLAUDE.md guidance should point atwt-addfor repos with a non-default integration branch.Acceptance:
EnterWorktreeinmanabot-alphaproduces a branch based onorigin/dev(clean PR, 1 commit) with deps installed.