Blog · Guide · 16 November 2026

Agent Fan-Out: Starting and Stopping Agents in Bulk

Agent fan-out is the pattern where one agent, or one person, starts many worker agents at once to do a job in parallel: one worker per package, per test file, per customer record. It is how a migration across two hundred modules gets done in an hour. It is also how two hundred processes end up running with nobody beside them, asking questions no one hears and continuing after the plan has changed. This guide explains what a fan-out needs to be safe, and how Forkit's fan-outs are designed.

What makes agent fan-out different

A few agents on your machine are supervised by proximity. You see their terminals. A fan-out removes that.

  • No terminal. Workers run in cloud sandboxes or CI agents' jobs. A permission prompt has no screen to appear on.
  • No individual attention. Nobody will read two hundred transcripts.
  • Shared fate. If the plan is wrong, every worker is wrong.
  • Shared questions. Workers doing the same job hit the same obstacles at the same moment.
  • Shared credentials are dangerous. One long-lived key copied into two hundred sandboxes is two hundred places to leak from.

So a fan-out needs five things: identity per worker, limits on the group, an answer for prompts without a person present, a way to answer once for many, and one stop.

Short-lived keys, one per worker

In Forkit, a fan-out starts with one HTTP request (or forkit fanout create):

curl -X POST https://forkit-mcp.com/api/v1/fanouts \
  -H "Authorization: Bearer $FORKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"migrate-http","agents":200,"ttl_seconds":3600,"max_tool_calls":20000}'

Per the documentation, the response contains the keys, shown once. Their properties:

  • Up to 1,000 keys in one request, named <name>-001, <name>-002 and so on. The key's name is the agent's name.
  • Short-lived keys. They expire after one hour by default and 24 hours at most.
  • They act under the starting agent's person. Every action traces back to someone.
  • They are restricted. A fan-out key cannot start another fan-out and cannot be the orchestrator. That rules out runaway recursion.
  • They do not count against a person's ordinary key limit and are not listed on the keys page.

Starting a fan-out is deliberately HTTP only, not available inside execute_code, because it returns keys and execution results are kept in a log.

Limits on the group

Forkit's fan-out limits, as documented:

Limit Value
Keys per request 1,000
Running fan-outs per workspace 20
Fan-outs started per agent per hour 10
Key lifetime 1 hour default, 24 hours maximum
Tool calls Optional max_tool_calls for the whole fan-out
Names Unique among running fan-outs

The tool call limit is counted in memory and written in steps, so it can overshoot by a few calls. It is a brake, not an exact meter.

Setting up the workers

Each sandbox needs the agent, the hooks and its key.

For Claude Code, forkit init --sandbox installs the hooks with no sign-in, no key and no question, and sets the hook to deny on timeout. The key arrives at run time in the FORKIT_API_KEY environment variable. If you would sooner commit the setup to the repository, forkit init --project writes .claude/settings.json and the hook script for you to check in.

A worker's startup then looks like:

export FORKIT_API_KEY="$KEY_FROM_FANOUT"
forkit init --sandbox
claude -p "Migrate packages/$PKG to the new HTTP client. Edit only that package. Hand off when done."

Sessions started with a fan-out key link to the fan-out's parent thread automatically, so each worker's handoff goes to the planner without extra configuration.

Permission prompts with nobody present

In a terminal, an unanswered request falls back to the local prompt. A sandbox has no local prompt. Forkit's rule for fan-out agents: an unanswered permission request is recorded as denied. The worker is told no and can continue with something else or report that it is blocked.

Before that point, the normal layers apply. Command rules answer routine requests at once. An orchestrator agent may answer for the tools an owner ticked. A person may answer from the inbox.

One answer for many workers

Two hundred workers migrating packages will all want to run the same install command within the same minute. Two hundred inbox items would be unusable.

Forkit groups them. Pending requests with the same fan-out, tool, subject and repository are one question. The inbox, the JSON inbox API and notifications show one item, and one person's answer settles all of them.

There is one exception: requests that touch production, secrets or money are never grouped. Each is answered alone.

Workers that stop together

A fan-out stops when:

  1. The agent that started it calls stop.
  2. That agent's person, or a workspace owner, stops it from the fan-outs page.
  3. Its time is up.
  4. Its tool call limit is reached.

After that, every request from its keys is answered with a 403 that says to stop and why. The Claude Code hook prints continue: false with the reason and refuses the tool call in hand. Pending permission requests are denied, file claims are released, and working and waiting threads move to idle.

For more on stopping, see how to stop a runaway agent.

What has been measured

Forkit's documentation reports one staging run, on 13 Nov 2026, of a scripted scenario: a planner migrating one package per agent, agents arriving 40 a second, each starting, prompting, claiming its package, making 8 tool calls, asking for the same install, being refused when nobody answered, handing off and ending. With 1,000 agents: 1,000 of 1,000 starts, prompts and claims were accepted; 800 of 800 permission requests were accepted, and 792 were recorded as denied when nobody answered (8 lost their long-poll); 800 of 800 handoffs were read by the planner; 200 of 200 runaways were stopped within 4 seconds. Median times were 4 seconds to start and 0.3 seconds per tool call.

Read that with its caveats. It was one run, on staging, with a script standing in for real agents. The documentation lists what was not measured: more than one workspace under this load, a person answering a grouped question, and a real fleet of hooks.

What a fan-out does not cover

Also from the documentation:

  • Codex in a sandbox. Its hooks need a trust step in a terminal.
  • A spending limit in money. Hooks do not report cost. Use the tool call limit and your model provider's controls.
  • Deleting the sandboxes. Forkit stops the agents. Your infrastructure removes the machines.

Forkit also does not provision sandboxes. You bring those.

A checklist before you fan out

  1. Run one worker by hand. Read its result.
  2. Run five. Check that their handoffs are what the planner needs.
  3. Write command rules for what every worker will ask.
  4. Set the key lifetime and the tool call limit.
  5. Decide who may stop the run.
  6. Have workers claim their files, so overlaps show early.
  7. Start the rest.

Related: background agents in CI and how to run 50 coding agents without merge conflicts.

Where Forkit fits

Forkit provides the keys, limits, grouped approvals and stop for a fan-out. You provide the planner and the sandboxes. It is free to try. More at forkit-mcp.com.