Subagents, and the one rule that keeps them safe
Send four researchers out at once. Just never let two of them write to the same file.
7 min read
Curious
0 XPResearch is slow because it is mostly waiting. Fetch a page, wait. Fetch the next one, wait. Do that for ten pages across four articles and you have spent an hour watching a spinner.
A subagent is a separate Claude working in its own context, on its own task, at the same time as the others. Send four out and the waiting overlaps.
A subagent is also just a file
--- name: article-researcher description: Research one article. SERP, scrape, Reddit, sources. tools: WebSearch, WebFetch, Read, Bash --- You research ONE article and return a research pack. You do NOT write the article. You do NOT write to the knowledge base. Return findings; the orchestrator applies them. Return: SERP list, heading maps, 2 authoritative sources with dates, 1-2 Reddit threads, and anything that contradicts the client KB.
The rule that stops the mess
Notice those two "do NOT" lines. They are the important part of the file.
Single writer
Workers never write to shared files. Only the orchestrator does. Workers gather and return. If four agents write to the same knowledge base at once, they overwrite each other, and the file that survives is whoever finished last.
This is not a Claude problem. It is the oldest problem in shared editing. The fix is the same one every version control system uses: one writer, everyone else submits.
Four writers
- Each agent updates the knowledge base directly
- Last one to finish wins
- Three findings silently vanish
- Nothing errors, so nobody notices
- You find out two weeks later
One writer
- Each agent returns findings as text
- Orchestrator merges all four
- Conflicts get seen and resolved
- The file is written once, deliberately
- You can read what changed
When not to bother
Subagents cost setup and they make failures harder to read. For one article, just do the work in the main session. The payoff starts at about three parallel tasks, and it is real from four up.
Who writes the file?
35 XP+9 perfectFour researchers each found a verified price for a different tool. All four need to land in competitors.md. What happens?
Pick the safe design.
Finished reading?
Mark it done to bank the XP and keep your streak alive. Any challenges on this page score separately, so you can come back for a perfect run later.