agent_summary re-sends each background agent's full transcript every ~30 s, with no way to turn it off
On 2.1.312 (Linux), every running background agent gets a summary request about every 30 seconds. Each request sends that agent's whole transcript to its own model so it can write a 3–5 word label for the agents panel.
I measured it with one background Haiku subagent running for about 3 minutes (8 × sleep 20), using --debug-file:
| Setup | [AgentSummary] Forking |
|---|---|
| Interactive session, default settings | 5 (every ~32 s; context 22 → 28 → 40 → 46 messages) |
CLAUDE_CODE_FORK_SUBAGENT=0 |
5 |
-p / Agent SDK client |
0 |
The request goes to the agent's own model (claude-haiku-5-5 in this test), so an Opus subagent is summarized by Opus. Example output: "Running sleep 20 for echo 5".
Three things make this hard to manage:
- No opt-out. The
CLAUDE_CODE_FORK_SUBAGENT=0workaround mentioned in #86879 no longer stops it on 2.1.312, and I couldn't find a setting that does. - Invisible to usage tracking. These requests aren't written to the session transcript, so cost tools that read transcripts don't see them (#104358).
- Not in the docs. The background token usage docs don't mention it.
For people who delegate a lot, this adds up. Others in #86879 report 15–26% of weighted tokens.
Suggestions, any of which would help:
- Build the label from data the harness already has: the last tool name plus its file or command, which
task_progressalready carries. That needs no model call. - Add a setting to turn the summaries off, and log these requests where usage tools can see them.
- If a model summary stays, use the smaller
shortnotes mode and a small model by default.
Happy to share debug logs.
This isn't a duplicate of #86879. It's the current-release measurement that thread has been missing, and it shows the workaround people keep recommending there doesn't work.
On 2.1.312 (Linux), one background Haiku agent running 8 × sleep 20, with --debug-file:
- Stock: 5
agent_summarycalls about 32 s apart, resending the agent's transcript as it grew from 22 to 46 messages. CLAUDE_CODE_FORK_SUBAGENT=0: still 5 calls. It does nothing on 2.1.312, although #86879 is still telling people to set it.CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES: can only turn summaries on (see the 2.1.312 bundle analysis in #86879).- A third-party Bun preload that patches the timer: 0 calls. Confirmed on Linux 2.1.312, macOS 2.1.310 and a second Linux host on 2.1.309.
So, two and a half months after #86879:
- There is still no supported way to switch off a feature that resends each background agent's full transcript every 30 seconds for a 3–5 word label.
- The calls run with
skipTranscript, so no transcript-based usage tool can see them (#104358), and the "Background token usage" section of the docs doesn't mention them. - The only working off switch is users injecting a gist into every Claude Code process. That's a worse security outcome than a one-line setting would be.
- On Hacker News (item 50284699) a Claude Code team member confirmed the mechanism. They said a fix for summaries that miss the prompt cache shipped in 2.1.311+, and that a cheaper mode (short notes to a smaller model) is in progress. Thanks, that's welcome. But 2.1.312 still sent 5 full-transcript calls in 3 minutes in the test above, and that reply doesn't mention an off switch.
Please keep this open until there's an answer here: will the cheaper mode ship with an opt-out, and is there a timeline?
I read the 2.1.312 linux-x64 and darwin-arm64 builds from npm. They have the same code for this, and only the minified names differ.
In an interactive session, a background agent gets summaries only when the fork gate is open or coordinator mode is on. CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES counts only in sessions that are not interactive. The fork gate closes when CLAUDE_CODE_FORK_SUBAGENT is 0, false, no or off, and it reads the variable before any server flag. So once the process sees 0, neither the platform nor a server flag can keep summaries on. This also fits your -p row. A -p session is not interactive, so the fork gate does not matter there.
That leaves the value the process ends up with. At startup, Claude Code writes each settings env block over the environment from the shell. I tested this on 2.1.310 with CLAUDE_CODE_FORK_SUBAGENT=0 exported and "1" in a --settings env block. The session saw 1, and a background agent got 3 summary calls. With only the export, it got 0.
Could you run these two checks where the switch failed?
-
In the interactive session where the switch failed, run:
! env | grep -E 'CLAUDE_CODE_(FORK_SUBAGENT|COORDINATOR_MODE)' -
Search your settings files for the variable:
grep -n CLAUDE_CODE_FORK_SUBAGENT ~/.claude.json ~/.claude/settings*.json .claude/settings*.json /etc/claude-code/managed-settings.json /etc/claude-code/managed-settings.d/* 2>/dev/null
If your test started Claude Code through tmux, note that CLAUDE_CODE_FORK_SUBAGENT=0 tmux new-session ... does not pass the variable on when a tmux server is already running.
I also ran this on Linux. I used Claude Code 2.1.312 from the native installer (linux-arm64) on Ubuntu 24.04, in an interactive session in tmux. No settings file set the variable. In each session, one background Haiku agent made five sleep 20 calls. I counted the [AgentSummary] Forking lines in each --debug-file log.
CLAUDE_CODE_FORK_SUBAGENT |
Summary calls |
|---|---|
| unset | 3 |
0, exported |
0 |
I passed the variable with env inside the tmux session's command, and /proc/<pid>/environ of the claude process showed CLAUDE_CODE_FORK_SUBAGENT=0.
So the switch also works on Linux 2.1.312 once the process sees 0. The two checks in my earlier comment should show what differs in your setup.
@canneyi thanks, you were right. I reran it and the switch works. My earlier CLAUDE_CODE_FORK_SUBAGENT=0 row was wrong.
Your two checks first:
- No settings
envblock setsCLAUDE_CODE_FORK_SUBAGENTorCLAUDE_CODE_COORDINATOR_MODE(~/.claude/settings.json,settings.local.json, the project settings, no managed settings). Neither variable is in my shell's environment by default. /proc/<pid>/environof theclaudeprocess showedCLAUDE_CODE_FORK_SUBAGENT=0in the test session and nothing in the control.
Rerun on 2.1.312 (Linux, WSL2, native install). Two interactive sessions started side by side in tmux, Sonnet main model, one background Haiku agent running sleep 20 five times, --debug-file on both:
CLAUDE_CODE_FORK_SUBAGENT |
[AgentSummary] Forking |
|---|---|
| unset | 3 (about 31 s apart; context 21 → 26 → 36 messages) |
0, exported |
0 |
I can't reconstruct the environment of my 30 Oct run, so I don't know why it still showed 5 calls. The env var is a working opt-out on 2.1.312, but it also turns off forked subagents. That's why a dedicated setting (#86879) is still worth having.
This is available in Claude Code 2.1.318, so we're closing this issue. If you disagree, let us know here and we can re-open it. Thanks for reporting!