How brefledev/stop-subagent-fanout works
stop-subagent-fanout is a small Claude Code hook and installer. The main workflow is: install the gate and configure a PreToolUse matcher, then Claude Code invokes the gate before matching tool calls; the gate returns an approval decision and records an audit entry. The README documents the human prompt and environment override. Runtime behavior is supported by the sampled scripts; configuration and prompt behavior are also documented in the README.
Main entry points: subagent-gate.mjs Gate script · install.mjs Installer · settings.example.json Hook example
Components 8
Project setup
- Installer
install.mjs - Hook example
settings.example.json - Project settings
Spawn gate
- Gate script
subagent-gate.mjs - Session environment
- Decision log
Other components
- Project owner
- Claude Code
Connections 11
- Project owner → Installer: runs
- Installer → Gate script: copies
- Installer → Project settings: updates
- Hook example → Project settings: merge manually
- Project settings → Claude Code: configures hooks
- Claude Code → Gate script: invokes before tool
- Claude Code → Gate script: pipes hook JSON
- Session environment → Gate script: provides override
- Gate script → Claude Code: returns decision
- Gate script → Decision log: appends decisions
- Claude Code → Project owner: prompts for approval