Replace open-ended autonomy with a tested call budget
Use when. A paid, unattended, or recursive Claude Code session can invoke WebSearch or spawn subagents—especially research, repository audits, verification panels, and resumed background work.
Action.
Upgrade
to
Claude
Code
2.1.212
or
later.
Derive
each
ceiling
from
the
planned
fan-out
plus
small
retry
headroom;
do
not
inherit
200
by
accident.
For
an
unattended
research
job
expecting
six
workers
and
about
ten
searches,
launch
with:
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION=12
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION=8
claude
Put the variables in the parent process environment for cron or CI; prompt prose is not enforcement. Before rollout, run two disposable low-cost canaries: set one ceiling to two, keep the other above the test, and explicitly request three sequential calls.
Acceptance check. In each canary, the transcript records no more than two WebSearch calls or two new subagent spawns; the third request returns a limit signal without creating another tool event or subagent transcript. Any third dispatch, silent retry, or continued fan-out blocks deployment.
2.1.212
release
and
Week
29
documentation
name
both
variables,
their
200-call
defaults,
and
the
runaway-loop
purpose.
Independent
versioned
issue
artifacts
show
the
failure
shape:
issue
#68110
records
one
research
request
producing
48-plus
agents
and
1.5-million-plus
tokens;
#77060
preserves
a
July
13
resume-path
reproduction
with
nearly
100
agents
and
256-plus
task
files.
Caveat.
These
are
lifetime
call-count
caps,
not
concurrency,
nesting-depth,
per-agent-turn,
token,
wall-clock,
or
monetary
budgets.
They
do
not
cover
WebFetch,
shell
networking,
or
MCP.
Anthropic
explicitly
says
/clear
resets
the
subagent
budget,
so
treat
a
clear
as
a
new
allowance
and
retain
an
external
spend
ceiling.
The
closed-source
release
publishes
no
regression-test
output;
keep
the
canary
as
a
deployment
gate.