subagent-broker
Skill0 starsChanged 7 months agoMITView on GitHub
Battle-tested Task-tool delegation templates that survive the subagent-delegation pitfalls reported in issues #4182, #5528, and #19077. Use this skill when the user runs /claude-papercuts:subagent-broker, asks how to delegate work to subagents reliably, asks when to use the Task tool, says their subagents ignore configuration or CRITICAL directives, or wants a template for parallel search / independent review / cross-file audit. Runs templates.py to list named delegation patterns and prints the one matching the user's situation.
In this repository9 other files it gives its agents.
- amnesia-fixSkill
- compact-guardSkill
- done-proverSkill
- onboardSkill
- safe-shellSkill
- skill-budgetSkill
- skill-doctorSkill
- token-x-raySkill
- unclearSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Run the templates script to see what's available:
- Distinctive: line 52
Ask the user which delegation flavor matches their task:
- Very specific: line 68
Never invoke Task blindly.
- Distinctive: line 122
If Anthropic ships first-class delegation reliability (per issues
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
subagent-broker — Task-tool delegation patterns that actually work
What this prevents
"Sub-agents claim no Task tool access despite configuration stating tools: Read, Write, Edit, Task. CRITICAL rules are completely disregarded. No actual delegation occurs." — issue #5528
"Sub-Agent Task tool not exposed when launching nested agents." — issue #4182
The Task tool is the official delegation mechanism, but it fails silently when the delegation prompt isn't structured right:
- Open-ended prompts return shallow output
- "CRITICAL" / "ALWAYS" directives are ignored
- Briefed-with-conclusion prompts produce sycophantic "yes" answers
- Subagent results aren't shared between subagents (people assume they are)
subagent-broker ships the prompt skeletons that survive these
pitfalls — distilled from the issue threads themselves.
The templates
| Template | When to use |
parallel-search | N independent searches at once (call all Task tools in one message) |
single-research | One open-ended exploration noisy in the main context |
cross-file-audit | Consistency review across files (front-load + re-assert the rule) |
known-target | Don't delegate — use Read/Grep directly |
independent-verification | Second opinion without anchoring on your conclusion |
How to invoke (the actual procedure)
Run the templates script to see what's available:
${CLAUDE_PLUGIN_ROOT}/skills/subagent-broker/templates.py- Ask the user which delegation flavor matches their task:
- Parallel search across the codebase →
parallel-search - One deep research question →
single-research - Cross-file consistency check →
cross-file-audit - "I know exactly which file I need" →
known-target(don't delegate) - Second opinion / independent review →
independent-verification
- Parallel search across the codebase →
Print the chosen template:
${CLAUDE_PLUGIN_ROOT}/skills/subagent-broker/templates.py <name>- Adapt the placeholders (
<files>,<specific concern>, etc.) to the user's actual task. Then make the Task call yourself. - Never invoke
Taskblindly. The user should see the proposed delegation prompt and approve it before you fire.
The non-obvious rules (from the issues)
- State the most-important constraint twice. Once near the top of
the prompt, once in the response-format section.
CRITICAL/ALWAYSkeywords don't help; placement does. (issue #5528) - Cap the response length explicitly. Subagents will read every file they find if you don't tell them not to.
- Parallelize in a single message. Two
Taskcalls in two consecutive messages run sequentially. TwoTaskcalls in the same message run in parallel. - Don't tell the subagent your conclusion. They'll anchor on it. For verification, withhold your analysis.
- Subagents are 5-10× more expensive than a direct tool call. Delegate only when the subagent will make 3+ tool calls.
When to auto-invoke
- User runs
/claude-papercuts:subagent-broker - User asks how to use Task / subagents / delegation
- User says subagents ignore their config / CRITICAL rules
- User wants a template for parallel work / cross-file review
What this skill does NOT do
- It does not fire the Task tool for you. You (Claude) call Task yourself with the adapted template — the user reviews the prompt first.
- It does not validate that your delegation succeeded. The subagent's own output is the verdict.
- It is not a queue / dispatcher. Earlier drafts of this skill shipped a queue + spawn system; we cut it because it duplicates what Anthropic's Task tool already does.
Configuration
# List every template
${CLAUDE_PLUGIN_ROOT}/skills/subagent-broker/templates.py
# Print one ready to paste
${CLAUDE_PLUGIN_ROOT}/skills/subagent-broker/templates.py parallel-search
# Filter by keyword
${CLAUDE_PLUGIN_ROOT}/skills/subagent-broker/templates.py --search research
# Machine-readable
${CLAUDE_PLUGIN_ROOT}/skills/subagent-broker/templates.py --jsonDeprecation plan
If Anthropic ships first-class delegation reliability (per issues #4182, #5528, #19077), the templates become less load-bearing and this skill can simplify or deprecate.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

