Repository navigation
fix: a worker in the app's worktree moves to the task's worktree beside the main checkout - #74
Merged
Merged
Conversation
…task's worktree beside the main checkout In an adopting project, every task worktree ended up nested in main/.claude/worktrees/ under a generated name. The desktop app gives every chip's session a worktree of its own, at its worktree location (inside the project by default), so the session never opened in the main checkout as decision 0021 assumed. Then the session-context hook told the worker "this worktree is yours for one task... rename the generated branch", and workers did — the prompt's "create this task's worktree and move" lost. Nested in the main checkout, the worktrees also walked up into its ESLint config. With the parallel-agents module, a session in Claude Code's own worktree on a generated branch or a detached HEAD now creates the task's worktree beside the main checkout (adf-worktree-new <branch> --no-start) and moves there (change_directory, which the approve-worktree-move hook approves). It edits and commits nothing in the app's worktree, which goes when the session is archived, and never renames its branch. A worktree already on a task branch keeps working as before. /dispatch, PARALLEL-AGENTS.md, and the parallel-agents scenario no longer tell the developer to start the chip "in this folder"; the worker moves either way. Decision 0040 amends 0021 and 0015. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In an adopting project, every task worktree ended up nested in
main/.claude/worktrees/under a generated name (silly-cannon-b424ff, …), and none sat beside the main checkout. Two things combined:claude/<name>branch. The session never opened in the main checkout, as decision 0021 assumed.adf-worktree-newand move into it") lost to the hook.Nested in the main checkout, the worktrees also walked up into its tool configuration: ESLint failed on the main checkout's config.
What changed
plugins/adf/hooks/session-context.sh, with the parallel-agents module:adf-worktree-new <branch> --no-start, with the branch its prompt names or the one triage names, then a move to the path it prints (change_directory, which the approve-worktree-move hook approves;EnterWorktreein a terminal)./adf:dispatch,docs/PARALLEL-AGENTS.md, the parallel-agents scenario: they no longer tell the developer to start the chip "in this folder, not in a new worktree". The app decides that, and the worker moves either way. A rationalization row covers "the chip already gave me a worktree".For reviewers
/wrap-up).Verification
./evals/run-evals.sh: all suites pass.git branch -m. A worktree already on a task branch keeps its notes./dispatchand the hook), and one updated to the hook's current wording.python3 scripts/build-committed.py --check: the round trip holds, with 65 files.🤖 Generated with Claude Code