docs(agents): add parallel agent coordination protocol to CLAUDE.md#430
Merged
docs(agents): add parallel agent coordination protocol to CLAUDE.md#430
Conversation
Adds write-scope partitioning pattern, prompt template, and pre-spawn checklist to prevent silent file-collision overwrites when spawning parallel sub-agents (observed as W2/W3 cycle collisions, issue #425). https://claude.ai/code/session_01BojvrVjuAKWkJFda4dBMDU
…tion - Use git log for collision check (git diff --name-only is ambiguous after commits) - Add "no globs" note on write scope - Add guidance for dynamic file discovery during execution - Add shared-file ownership rule for checklist - Drop misleading "was introduced after" rationale paragraph; replace with present-tense enforcement rule https://claude.ai/code/session_01BojvrVjuAKWkJFda4dBMDU
a87a22e to
ee7f303
Compare
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.
Closes #425
Adds a
## Parallel Agent Coordinationsection toCLAUDE.mdwith a write-scope prompt template, pre-spawn checklist, and enforcement rationale. The W2/W3 collisions observed in issue #425 occurred because parallel sub-agents had no mechanism for declaring which files they owned; this pattern establishes that contract at the prompt level, which is the only enforcement point available (agents do not detect or refuse out-of-scope writes at runtime).The section covers: (1) a prompt template with explicit read/write scope fields (write scope requires exact paths, no globs), (2) a four-step pre-spawn checklist including dynamic-discovery handling and shared-file ownership assignment, and (3) a post-completion collision check using
git log --name-only.What tested
ruff check src/— passed (docs-only change, no Python source modified)mypyorpytestchanges required (CLAUDE.md is not imported or tested)Pre-PR review
git log --name-only --diff-filter=ACM --oneline -<N>is more reliable than the current form for avoiding noise from merge commits — not a blocker.Session: https://claude.ai/code/session_01BojvrVjuAKWkJFda4dBMDU
Generated by Claude Code