prefer-fork-agents — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited prefer-fork-agents (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Before applying any rule below, check your own role. If any of these are true, you ARE a fork-worker:
‹fork-boilerplate› block appears in your promptfork-context-ref / attributionAgent: forkAgent(subagent_type:"fork", …) returns Fork is not available inside a forked workerIf you are the fork: the default-to-fork rule and the entire fan-out machinery in this skill do NOT apply to you. Execute the task directly with your existing tools (Read, Bash, Edit, Grep, etc.). Do NOT attempt to spawn further agents — neither fork nor named — because the runtime ‹fork-boilerplate› directive forbids any Agent-tool spawn from inside a fork, not just recursive forks. This rule overrides every "default-to-fork" sentence that follows.
If you are the parent (top-level session): the rules below apply normally.
This self-check exists because forks inherit the parent's active skills. Without it, a fork would read the "default to fork" mandate, attempt to spawn — and hit the no-recursion guard. The skill's own inheritance is the source of the failure; this block neutralizes it.
A fork agent is a Claude Code subagent that inherits the parent's full conversation state — system prompt, message history, active skills, tool definitions, CLAUDE.md, and the project's prompt cache. It runs with its own fresh 200K context window on top of that inherited state. The schema difference from a normal subagent is subagent_type: "fork" on the Agent tool call. Forks cannot spawn further forks (no recursion — a ‹fork-boilerplate› system instruction is injected that explicitly forbids it) and are mutually exclusive with coordinator mode.
Fork. Set subagent_type: "fork" explicitly:
{
"name": "Agent",
"input": {
"description": "Brief label, 3-5 words",
"subagent_type": "fork",
"prompt": "Directive: WHAT to do. Do not repeat context the fork already inherits — be terse and scope-focused. The fork has read everything we have read and discussed everything we have discussed."
}
}Named subagent (exception case). Include the named subagent_type:
{
"name": "Agent",
"input": {
"description": "Brief label",
"subagent_type": "Explore",
"prompt": "Full briefing: goal, constraints, expected output format, anything the agent needs to know — it starts with ZERO conversation context."
}
}Important — verified in Claude Code v2.1.177: omitting subagent_type does NOT trigger fork mode; it falls back silently to general-purpose (a fresh agent with no inherited context). The trigger is the literal string "fork" in the subagent_type field.
Verification signatures of a real fork in the session JSONL at ~/.claude/projects/<project>/<session>/subagents/agent-<id>.jsonl:
{"type":"fork-context-ref", "parentSessionId":..., "parentLastUuid":..., "contextLength":...} — this is the load-bearing signal that the fork inherited the parent's context.‹fork-boilerplate› block injecting the no-recursion directive and worker rules."attributionAgent":"fork". Note that line 2 is the parent's carried-over Agent tool_use call and does NOT carry this field — that absence is structural, not a failure signal.Fastest single check: if line 1's type is "fork-context-ref", it's a real fork. The other signatures only matter when debugging a suspected fallback.
Fork mode needs CLAUDE_CODE_FORK_SUBAGENT=1 in ~/.claude/settings.json, read at startup. A plugin can't set it. If a fork dispatch errors with this unset, tell the user to run /Claude-Full-Context-Agent:doctor — it runs the bundled installer for their OS (sets the var, installs skills) — then restart Claude Code. One-time; later sessions already have it.
The fork-vs-named decision is downstream of a more fundamental question: should you dispatch multiple agents in parallel at all? Resolve this FIRST.
Fan out (multiple agents in parallel) when:
Do NOT fan out when:
If the answer is "do not parallelize", dispatch a single agent (still fork by default per the rule below). If the answer is "parallelize", proceed to the fork-vs-named decision below — AND consult the fork-fan-out skill for orchestration patterns (worktrees, reporting contracts, parent-merge sequence).
Default: fork. Choose a named subagent_type only when one of these applies:
general-purpose with a fresh brief.subagent_type: "Explore" (runs on Haiku) for "find all files matching X", "where is function Y called", or other simple codebase scans where inherited context provides no benefit but Haiku speed/cost does.subagent_type: "Plan" for read-only architectural analysis that must not modify files.~/.claude/agents/ with a deliberately curated system prompt — e.g. a security auditor or test-engineer persona — that should NOT inherit the parent's framing.If none of these four cases applies, dispatch a fork. If you cannot articulate which case applies, dispatch a fork. Silence around "why named" is itself the signal that fork is correct.
For cases 1 and 4: the named subagent receives ZERO conversation context. Brief it like a stateless worker — focused scope, explicit constraints, specific output format. Do NOT assume it inherits anything from the conversation. The principle is the inverse of fork prompting: write a complete, self-contained briefing.
fork-fan-out skill for the empirical basis.fork-fan-out.)claude --print (headless) mode.isolation: "worktree". Without it, parallel forks share the same working directory and risk overwriting each other's edits or producing silent merge conflicts. Read-only fan-outs (search, analysis, reporting) do not need worktree isolation. Project .gitignore should exclude .claude/worktrees/ — see fork-fan-out skill.After a fan-out returns, run this ritual before considering the work done. Non-optional for fan-outs that include edits — skipping it produces silent regressions where individual forks succeeded but the combined state is broken.
isolation: "worktree" this surfaces as parallel branches that need a manual reconcile step.For single-fork dispatches, steps 1 and 3 still apply. Step 2 is moot, step 4 less critical. For multi-fork fan-outs, the fork-fan-out skill expands this ritual with registry tracking and merge-stage discipline.
User asks: "Spawn an agent that researches the Superpowers project on GitHub."
Wrong move (improvising a named subagent):
Agent(description="research superpowers",
subagent_type="researcher",
prompt="Research Superpowers... [needs full briefing because zero context]")Correct move (fork — the parent already knows what Superpowers is from this conversation):
Agent(description="GitHub research on Superpowers",
subagent_type="fork",
prompt="Research the obra/superpowers repo on GitHub. Return: feature list, recent release notes, comparison to the alternatives we already discussed.")The fork-prompt is shorter precisely because the fork already inherits "the alternatives we already discussed". With a named subagent, that reference would have to be expanded into the prompt, doubling its length and risking summarization loss.
Right before you emit an Agent/Task tool call, ask the three questions in order:
fork-fan-out for orchestration.subagent_type: "fork" explicitly)subagent_type: "Explore"isolation: "worktree" to each fork.After dispatch returns, run the post-dispatch verification ritual.
Apply silently. Do not narrate the decision tree unless asked.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.