Agent warmup mode causes infinite retry loop with high API traffic

Resolved 💬 6 comments Opened Jan 8, 2026 by maxim-uvarov Closed Feb 26, 2026

Description

When an agent enters "warmup" mode, it gets stuck in an infinite retry loop where every tool call returns an error. The agent keeps retrying indefinitely without any backoff or maximum retry limit, causing excessive API traffic and token consumption.

Environment

  • Claude Code version: 2.1.1
  • Model: claude-opus-4-5-20251101
  • OS: macOS (Darwin)

Steps to Reproduce

The issue occurred during normal agent usage. The exact trigger for entering "warmup" mode is unclear, but once in this state:

  1. Agent receives "Warmup" as initial message
  2. Agent attempts tool calls (Bash, Glob, etc.)
  3. Every tool call returns {"is_error": true, "content": "Warmup"}
  4. Agent retries the same commands indefinitely

Observed Behavior

  • Session duration: ~16 minutes before manually killed
  • Total messages logged: 615
  • Context grew from ~11K to ~54K cached tokens
  • API calls every 2-3 seconds with no backoff
  • Same commands retried hundreds of times

Example from log:

{"type":"tool_use","name":"Bash","input":{"command":"ls -la /Users/.../nu-goodies"}}
// Result:
{"is_error":true,"content":"Warmup","tool_use_id":"toolu_..."}
// Agent immediately retries the same command...

Expected Behavior

  • Agent should have a maximum retry limit for failed tool calls
  • Agent should implement exponential backoff on repeated failures
  • Agent should recognize when stuck in an unrecoverable state and exit gracefully
  • "Warmup" mode errors should not cause tool execution failures

Impact

  • High network traffic (continuous API calls)
  • Significant token consumption (Opus model)
  • Process must be manually killed
  • Poor user experience

Attachments

I have the full agent log file (agent-a7667df.jsonl, 467KB, 615 lines) available if needed for debugging. The log contains only failed tool calls with "Warmup" errors - no actual file contents were captured.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗