diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-22 15:13:05 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-22 15:13:05 -0500 |
| commit | 52202bb182dddd036b82d8863527dde4ff265967 (patch) | |
| tree | 11f1c9cbfa5ecbc512fe8c17fe5092c8bbf366fb /claude-rules | |
| parent | e5a01fd95771962f0ec3d0164266137f84975f39 (diff) | |
| download | rulesets-52202bb182dddd036b82d8863527dde4ff265967.tar.gz rulesets-52202bb182dddd036b82d8863527dde4ff265967.zip | |
docs(rules): add pre-dispatch availability and cost checks
subagents.md assumed the Agent tool exists. A new "Pre-Dispatch Checks" section adds two gates before any spawn: Availability (no Agent capability means do the work in the main thread under the same scope and constraints the contract would enforce) and Cost (when writing the full contract costs more than the task, do it inline). Both cross-reference the existing "Don't Subagent At All" guidance rather than duplicating it.
Diffstat (limited to 'claude-rules')
| -rw-r--r-- | claude-rules/subagents.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/claude-rules/subagents.md b/claude-rules/subagents.md index 310f979..8578dea 100644 --- a/claude-rules/subagents.md +++ b/claude-rules/subagents.md @@ -7,6 +7,33 @@ independent work. They are not free — every spawn pays a prompt-construction cost and breaks the chain of context from the current conversation. Use them deliberately, not reflexively. +## Pre-Dispatch Checks + +Run these two checks before any spawn. Both can send the work back to the +main thread without the spawn ever happening. + +### Availability + +The dispatch path assumes a subagent/Agent capability exists in the +environment. If it doesn't — no Agent tool, no spawn mechanism — don't +block. Do the work in the main thread, but preserve the same scope +boundaries the subagent contract would have enforced: bounded scope, the +explicit "do NOT" constraints, and the named output shape. The discipline +is in the contract, not the tool. Hold the task to it even when you're the +one executing, so the work doesn't sprawl. + +### Cost + +Dispatching isn't free — it pays the prompt-construction cost and breaks +context continuity (see the opening paragraph). For a small task, writing +the full contract (scope, context, constraints, output format) can cost +more than just doing the task inline. When that's the case, do it inline. +The subagent earns its place by absorbing context pollution and running +work in parallel, not on tasks where the handoff exceeds the work itself. +This is the same boundary the "Don't Subagent At All" section and the +"Subagenting trivial work" anti-pattern draw; treat it as an explicit gate +at dispatch time. + ## When to Spawn a Subagent ### Parallel-safe (spawn multiple in parallel) |
