Stop Subagent Fanout — Development skill for Claude Code
Makes Claude Code ask for permission for each subagent fan out / spawning / swarming.
How to install Stop Subagent Fanout
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open brefledev/stop-subagent-fanout and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Stop Subagent Fanout does
Makes Claude Code ask for permission for each subagent fan out / spawning / swarming.
Alternatives in Development
- OpenAI Codex CLI — (Rust implementation) 67.8k ★
- Research Codebase — You are tasked with conducting comprehensive research across the codebase to answer user questions by spawning 10k ★
- 11 Permission Explainer — Permission Explainer System Prompt 2.3k ★
README
stop-subagent-fanout
A Claude Code hook that makes the model ask before it spawns a subagent. One prompt per spawn, and you can refuse any of them.
Left alone, a model can decide to launch a batch of subagents on its own. Each one costs tokens, and each one does work you never watched happen. Telling it "ask me first" in `CLAUDE.md` or a system prompt is a suggestion — a fresh session or a confident model steps over it. This wires the rule to something that runs whether the model cooperates or not.
If the model tries to spawn eight subagents, you get eight prompts. In an unattended run, spawns are denied by default. One environment variable lets you pre-approve a run, and the model can't set that variable itself.
If you'd rather DIY
The gate is one small script and one hook entry. If you'd rather have your own model write it, paste the description below, (and read what it produces before you trust it).
Paste this:
Write a Claude Code `PreToolUse` hook script called `subagent-gate.mjs` — Node, no dependencies — for the `Task`, `Agent`, and `Workflow` tools. It reads the hook JSON from stdin. Default: print a permission decision of `ask` so Claude Code prompts me before each subagent spawn. If the environment variable `SUBAGENT_GATE=allow` is set, print `allow` and skip the prompt. On any missing input or JSON parse error, exit 0 so a broken hook never wedges my tools. Append every decision to a `.subagent-gate.log` beside the script. Then wire the matching `PreToolUse` hook — matcher `Task|Agent|Workflow` — into `.claude/settings.json`, leaving my existing hooks in place.
You get the same behavior this repo ships.
"haha tokens go brrrr"
A prompt-level rule lives in the model's context, which means the model decides whether to follow it. It drops that decision in predictable places: a new session that never read your note, a long context where the instruction fell off the back, a model that's convinced the swarm is a good idea. When the model ignor
Related Skills
Prun
Run prun: parallel delegation fan-out (Codex-primary, Opus coordinates)
Final Review
Orchestrate the final review fan-out (integration + diversity + risk + release readiness)
Fan Out
Prepare independent slices with explicit ownership and integration evidence for authorized delegation.
Book Stay
Choose and book a hotel (or stay) — quiz preferences, generate shortlist, verify rates, hand off booking, fan
Wf Max
Run WF-MAX with mandatory subagent fan-out and recorded degradation
Regression
Codebase-wide regression scan — fan out per-area review subagents in parallel, dedupe against existing issues,
Related Agents
Keel Fanout
Wide mechanical reading delegated from a keel fan-out skill. Reads a named area, cites path:line, and reports
Maker Decomposition Discriminator
MAKER Decomposition Discriminator - Validates task decompositions. MUST BE USED AUTOMATICALLY after maker-deco
Permissions Manager
Manage tool permission rules. Use when user says 'allow', 'deny', or 'ask' for a command, wants to modify perm