Home / Blog / Claude Code wastes tokens for "Waiting" notifications
Tech News

Claude Code wastes tokens for "Waiting" notifications

Claude Code subagents waiting on background processes trigger repeated parent wakeups that re-read over 220,000 context tokens per notification event.

By Dillip Chowdary • Nov 28, 2026 • Source: github.com

Claude Code wastes tokens for "Waiting" notifications
Image: github.com

At a glance

Product
Claude Code
Affected Versions
2.1.296, 2.1.299, 2.1.312, 2.1.314
Platform
Linux and macOS Darwin 27
Median Context Reload
226K tokens per notification wake
Subagent Foreground Cap
180 seconds automatic background limit
Wasted Parent Turns
132 of 283 weekly notifications in testing

Anthropic released Claude Code 2.1.312 with multi-agent orchestration, but background subagents waiting on local tasks trigger unbounded parent model wakeups, according to github.com's report. When an asynchronous helper starts a shell process or monitor tool and pauses, the framework sends repetitive task notifications with completed status markers to the lead session. Every interim ping forces the parent model to execute a complete reasoning turn, re-reading the full conversational transcript just to register that background jobs remain in progress.

This analysis examines the root causes of the notification loop, the measured token waste across production sessions, temporary mitigation hooks, and open architectural requests filed on the issue tracker. The report is intended for software engineers, engineering managers, and autonomous agent architects running multi-model agent pools who need to control usage quotas and budget overhead.

01Subagent monitor loops wake parent sessions

A background subagent launched with the Agent tool can spawn its own shell process or monitor watcher before yielding execution to wait for completion. Whenever the child agent wakes on a monitor event and returns to waiting, it emits a task-notification with status set to completed alongside a summary reading that the agent is waiting on its own background work. Because each event is labeled as completed rather than an interim waiting state, the main coordinator cannot differentiate progress from periodic status updates.

The resulting notify-and-respond loop continues unchecked for the entire duration of the underlying background process. In a confirmed production reproduction involving a thirty-issue download and build queue, a single child agent produced more than thirty notifications in twenty minutes. The parent agent consumed a complete turn on every single delivery, repeatedly answering with remarks that execution was still running without new information.

The behavior reproduces reliably under both Linux and macOS environments across versions 2.1.296, 2.1.299, 2.1.312, and 2.1.314. In controlled tests running two parallel agents that print periodic counter strings every thirty seconds, the parent session received six notifications in forty seconds. The dispatch frequency matches the underlying monitor tool firing rate rather than genuine functional progress.

02Token waste and cache consumption metrics

Running multi-agent hierarchies under this notification architecture imposes substantial context reloading costs on the lead session. Lead sessions typically run on Opus 5.5, while delegated tickets execute on cheaper child models. Each unprompted parent wake forces the larger model to process its accumulated conversational history, converting zero-progress status pings into expensive cache reads.

MetricMeasured ImpactProduction Baseline
Median Context Re-read226K tokens per wake176 tokens generated output
Estimated Cost Per Wake$0.05 at Opus 5.5 ratesDependent on cache hits
Logged Multi-Week Cache69M cache-read tokens267 wakes across 51 sessions
Weekly Notification Share132 of 283 parent wakes46.6% empty waiting notices
Unbounded Poll Duration15–16 hours continuousBackground loop until kill

Individual user logs revealed that over forty-six percent of weekly parent wakeups delivered no actionable task results. Two background teammate agents trapped in shell polling loops pinged their coordinator continuously for fifteen to sixteen hours until operators manually terminated them. While individual cache-read operations remain relatively cheap in isolation, persistent polling rapidly exhausts organizational plan limits and fills terminal session transcripts with empty diagnostic chatter.

03Hook workarounds and shell execution caps

Developers have deployed custom PreToolUse client hooks to intercept subagent shell calls and force processes into the foreground. The hook inspects tool payloads for the presence of an agent identifier, leaves the main coordinator thread unaffected, and updates background flags to false with a ten-minute execution timeout. Foreground execution holds no model requests open, enabling subagents to pause without firing turn-completion signals.

  1. Check agent context Inspect hook input data to confirm the agent_id parameter belongs to a delegated subagent.
  2. Intercept background flags Target Bash and PowerShell executions where run_in_background is set to true.
  3. Rewrite execution parameters Grant permission while overriding the payload to set run_in_background to false and timeout to 600000.
  4. Preserve long jobs Allow commands containing an explicit long-job comment to remain in the background.
Command
if (data.agent_id && ['Bash','PowerShell'].includes(data.tool_name)
&& data.tool_input.run_in_background === true && !/#\s*long-job\b/.test(cmd)) {
 print({ hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'allow',
 updatedInput: { ...data.tool_input, run_in_background: false, timeout: 600000 } } });
}

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

Note: Testing on Claude Code 2.1.314 revealed that foreground commands inside interactive subagents are automatically demoted to background tasks after exactly 180 seconds regardless of custom timeout settings.

04Background demotion and hang detection limits

The mandatory 180-second foreground cap in interactive subagent sessions limits the effectiveness of local pre-tool hooks. When a child agent executes a build or test suite requiring three to five minutes, the runtime automatically shifts the job into the background with an assigned task identifier. Subagents respond by writing recurring poll loops that also hit the 180-second ceiling, cascading into secondary background shifts.

This behavior traps delegated subagents in repetitive polling cycles that conceal hanging processes from developers. In one tracked instance across twenty-six teammate transcripts, a subagent spent thirty minutes polling a failed test that was locked on a busy network port. Because the child agent never formally concluded its model turn during the polling script, the parent session avoided spurious wakeups at the expense of lost execution time.

The hardcoded 180-second timeout appears restricted to interactive CLI sessions, as automated non-interactive runs allow longer foreground tasks to finish without automatic demotion. Environment variables such as CLAUDE_CODE_AUTO_BACKGROUND_TIMEOUT_MS fail to override the threshold in current client binaries. Teams utilizing subagents must choose between paying coordinator token costs or accepting unmonitored child execution delays.

05Installation commands and runtime model controls

Developers testing agent configurations can manage updates, inspect installed binaries, and toggle execution models directly from the command line. Upgrading to the latest release ensures compatibility with ongoing multi-agent protocol patches and command-line options.

Command
npm install -g @anthropic-ai/claude-code

To switch active model assignments inside a live terminal session, use the internal model slash command:

Command
/model claude-fable-5-1

Teams can also launch dedicated terminal instances pinned directly to specific reasoning engines:

Command
claude --model fable

To establish a permanent engine preference across recurring interactive workflows, save the default model configuration within local user settings:

Command
claude config set --global model fable

Engineers have requested that Anthropic formally document subagent execution caps, provide per-agent foreground timeout controls, and introduce a native blocking wait command for child tasks. Adding dedicated waiting status codes and client-side notification deduplication would eliminate redundant parent wakeups without requiring custom interception hooks.

Frequently asked questions

Why does the parent session wake up when subagents are waiting?

Background subagents send task-notifications marked with completed status rather than an interim waiting state whenever their monitor tools record an event.

How many tokens are consumed during an empty waiting wake?

Production logs show a median coordinator wake re-reads 226K tokens of cached context to generate just 176 tokens of output.

Does overriding command timeouts prevent subagents from backgrounding?

Setting timeouts above 180 seconds fails in interactive sessions because the runtime automatically forces commands to the background at 180 seconds.

Sources

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →