Repository navigation
docs(worktrees): name scratch files per work item, since workers share one scratchpad - #4273
Conversation
…e one scratchpad Every subagent a Claude Code session dispatches writes into that session's one scratchpad, so two workers that both write a generic name overwrite each other: 13 scratch names were written by two to four workers each on 2026-10-16. The guide now names the deployment fact and points at the upstream Engineer rule (devantler-tech/agent-plugins#580) that names each scratch file with its issue or PR number and carries the rule into every dispatched brief. Fixes #4263 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devantler
left a comment
There was a problem hiding this comment.
🤖 Generated by the Agentic Engineer
Self-review (fallback — CodeRabbit, Codex and Cursor Bugbot unavailable)
Reviewed commit: 9b281ef12431903d298a4ec4b66e8ac0403a9442
- CodeRabbit: the monorepo's included allowance is spent: its summary on monorepo#4271 at 2026-10-17T05:19Z reads "up to 1 included review per hour; 0 remain after this review". Recovery: the next hourly allowance, about 06:19Z.
- Codex: "You have reached your Codex usage limits for code reviews", posted on monorepo#4272 at 2026-10-17T05:35:27Z. The limit is the account's, not that PR's. Recovery: the maintainer adds credits.
- Cursor Bugbot: "Bugbot couldn't run - usage limit reached", posted on monorepo#4272 at 2026-10-17T05:36:50Z. Recovery: the maintainer raises the limit.
Scope: the whole PR diff at this head, one paragraph in the worktree guide. Reviewed for accuracy against the evidence on #4263, for conflict with the rest of the contract, and against this repository's Review guidelines.
- The facts match #4263: subagents of one session share that session's scratchpad, and the census found 13 names written by two to four transcript files in the 24 hours to 2026-10-16 21:08 UTC. The wording now states that window exactly instead of "on 2026-10-16".
- The paragraph adds the deployment fact (where the shared scratchpad comes from) and points at the portable rule in the Engineer definition rather than restating it as a second source, as the definition guide requires. The upstream rule is devantler-tech/agent-plugins#580, so the PR body names the merge order.
- Nothing in the always-on core changes, so the 32 KiB instruction budget is untouched.
git-safety-contract.test.shand the layout contract pass at this head.
Verdict: no P0/P1 findings
The upstream rule (devantler-tech/agent-plugins#580) now has the dispatching session assign each worker its own token, so two workers on one item cannot collide on a purpose word. The guide says the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The run-loop and advance overlays showed /tmp/val.log and /tmp/out.log, fixed names every parallel worker would share. They now show a scratch path prefixed with the worker's token, as the scratch-file rule asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devantler
left a comment
There was a problem hiding this comment.
🤖 Generated by the Agentic Engineer
Self-review (fallback — CodeRabbit, Codex and Cursor Bugbot unavailable)
Reviewed commit: 35dfebca30bfcc7901108a467e27fb03e59ae463
- CodeRabbit: the monorepo's included allowance is spent: its summary on monorepo#4271 at 2026-10-17T05:19Z reads "up to 1 included review per hour; 0 remain after this review". Recovery: the next hourly allowance, about 06:19Z.
- Codex: "You have reached your Codex usage limits for code reviews", posted on monorepo#4272 at 2026-10-17T05:35:27Z. The limit is the account's, not that PR's. Recovery: the maintainer adds credits.
- Cursor Bugbot: "Bugbot couldn't run - usage limit reached", posted on monorepo#4272 at 2026-10-17T05:36:50Z. Recovery: the maintainer raises the limit.
Scope: the whole PR diff at this head: one paragraph in the worktree guide and the tee-to-a-file examples in the run-loop and advance overlays. Reviewed for accuracy against the evidence on #4263, for conflict with the rest of the contract, and against this repository's Review guidelines.
- The facts match #4263: subagents of one session share that session's scratchpad, and the census found 13 names written by two to four transcript files in the 24 hours to 2026-10-16 21:08 UTC. The wording now states that window exactly instead of "on 2026-10-16".
- The paragraph adds the deployment fact (where the shared scratchpad comes from) and points at the portable rule in the Engineer definition rather than restating it as a second source, as the definition guide requires. The upstream rule is devantler-tech/agent-plugins#580, so the PR body names the merge order.
- Since the round at
9b281ef1: the paragraph follows the upstream rule as revised for CodeRabbit's finding on #580 (the dispatcher assigns each worker its own token), and the two overlay examples that showed a fixed/tmp/val.logand/tmp/out.lognow show a per-worker scratch name, so the instructions no longer teach the collision the rule forbids. - Nothing in the always-on core changes, so the 32 KiB instruction budget is untouched.
git-safety-contract.test.sh, the layout contract and the self-review, review-provider-loop and provider-neutral-agents contracts (which read the two overlays) pass at this head.product-value-contract.test.shcannot run in this worktree because the business-site submodule is not populated here; the overlay lines it would read are untouched.
Verdict: no P0/P1 findings
Readiness at
|
Why
Workers started from one session all write their scratch files into the same folder, so a worker that uses a common name silently overwrites a sibling's file. In one day, 13 such names were written by two to four workers each, and two of the run instructions still showed one fixed name for every worker as the example to copy.
What
The working-copy guide now says that the scratch folder is shared and that each worker names its scratch files with its own token, and points at the shared rule in the Engineer definition, which also tells each session to hand every worker its token. The two run-instruction examples now use a per-worker name too.
Fixes #4263