Issue-113: give spawned worktree branches task-identifying names - #122
Draft
jodavis-claude wants to merge 2 commits into
Draft
Issue-113: give spawned worktree branches task-identifying names#122jodavis-claude wants to merge 2 commits into
jodavis-claude wants to merge 2 commits into
Conversation
Rename the branch (never the directory) of every isolation:"worktree" spawn immediately after the spawn call returns, from the outside (orchestrator's own checkout), before the spawned session does anything: worktree-<task_id> for workflow-orchestrate implement runs (concurrent-orchestrate step 1c.3), watch-<task_id> for watch-pr monitor runs (concurrent-orchestrate step 1e.2 and the manual /watch-pr command). This makes `git worktree list`'s branch column identify the task at a glance, including for worktrees still idle on their just-renamed branch before ensure-working-branch computes its own readable branch name - directly addressing the "hard to tell which ones are stale" half of the issue. Directory names are left untouched (renaming a live subagent's own cwd was judged too risky and unnecessary - the branch name alone already satisfies git worktree list at-a-glance identifiability). ensure-working-branch's own branch-naming template and the worktree-freshness hard stop are both unmodified; empirically verified that renaming a branch checked out in another worktree from the main checkout does not disturb that worktree's later git operations. Existing raw-hash worktrees already on disk and the WorktreeCreate hook approach are out of scope for this change.
build-and-test: Python test resultsStatus: ✅ Passed Test log |
watch-pr's step 2 was checking out working_branch before step 3 read HEAD to record watch_worktree_branch, so it captured working_branch instead of the just-renamed watch-<task_id> monitor branch. This left every renamed monitor branch permanently orphaned (never recorded, never cleaned up) and made the later `git branch -D <watch_worktree_branch>` cleanup target the wrong branch. Fix: capture watch_worktree_path/watch_worktree_branch in step 2 before the checkout switches HEAD away from the renamed branch, and record the already- captured values in step 3. Updated the doc text in concurrent-orchestrate's SKILL.md and commands/watch-pr.md that incorrectly claimed step 3 handled this correctly. Also added an explicit hard-stop instruction for rename failures other than a name collision, in both rename sites and the manual /watch-pr command, matching this repo's existing fault-tolerance convention.
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.
Work item: Issue-113 — concurrent implementation was creating worktrees/branches with opaque, Claude-Code-generated
agent-<8-hex>/worktree-agent-<8-hex>names, making it hard to tell at a glance which worktree belongs to which task, or which ones are stale.Changes:
plugins/dev-team/skills/concurrent-orchestrate/SKILL.md— step 1c.3 renames a freshly spawnedworkflow-orchestrateworktree's branch from Claude Code's opaqueworktree-agent-<8hex>toworktree-<task_id>immediately after the spawn call returns (run from the orchestrator's own non-worktree checkout), with a stale-leftover disambiguation fallback on name collision. Step 1e.2 applies the analogouswatch-<task_id>rename for auto-starteddev-team:watch-prmonitor spawns. Added a new top-level "Worktree naming" section documenting the convention, why the directory itself is left unrenamed, and that the fix is forward-looking only (existing on-disk worktrees are unaffected).plugins/dev-team/commands/watch-pr.md— the manual/watch-prspawn now applies the samewatch-<work-item-id>branch rename (with the same disambiguation fallback), so a manually-started monitor is just as identifiable as an auto-started one.Design decisions:
git worktree listbranch-name visibility alone.git branch -mon a branch checked out in another worktree, run from the main checkout, does not disturb that worktree (status/HEAD/commits all continued to work normally) — confirming orchestrator-side rename is safe.WorktreeCreatehook, since its input schema for task-identifying data was unverified/conflicting, and the orchestrator-side rename achieves the same goal without depending on it.worktree-/watch-) rather than reusinggit-repo.working-branches.task's template, soensure-working-branchnever mistakes the renamed branch for one that already exists and needs pulling.Closes #113
Testing completed: No application/Python code changed — only agent-instruction prose in
SKILL.md/command markdown files. Confirmed viadev-team:missing-test-harnessandCONTRIBUTING.mdthat this repo has no test harness for documentation/prose changes, so none was invented. No.feature/Gherkin E2E harness exists in this repo, so no E2E scenarios were added.