claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] API Error (Request timed out.) · Retrying in 35 seconds… (attempt 9/10)

Open timyal opened this issue 1 year ago • 3 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [x] Other:
  • Claude CLI version: 1.0.21 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: Termius

Bug Description

Steps to Reproduce

  1. While compacting
  2. none
  3. none

Expected Behavior

simply "compacting".

Actual Behavior

⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10) ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10) ⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10) ⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10) ⎿ API Error (Request timed out.) · Retrying in 8 seconds… (attempt 5/10) ⎿ API Error (Request timed out.) · Retrying in 17 seconds… (attempt 6/10) ⎿ API Error (Request timed out.) · Retrying in 40 seconds… (attempt 7/10) ⎿ API Error (Request timed out.) · Retrying in 36 seconds… (attempt 8/10) ⎿ API Error (Request timed out.) · Retrying in 35 seconds… (attempt 9/10)

✶ Compacting conversation… (726s · ↑ 144 tokens · esc to interrupt)

Additional Context

Every time when the code reaches the compact point and autostarts compacting, this happens.

timyal avatar Jun 12 '25 12:06 timyal

the problem is "env": { "MAX_THINKING_TOKENS": "32000" } , remove it

furkancak1r avatar Jun 19 '25 07:06 furkancak1r

From Anthropic Support to me:

"The timeout issues with long todo lists appear to be related to the extended processing time required for complex multi-step tasks, which can exceed the default API timeout limits. As a workaround, you can increase the API timeout by setting the API_TIMEOUT_MS environment variable before launching Claude Code. For example, you can use the export API_TIMEOUT_MS=600000 command to set it for 10 minutes. The default appears to be 30 seconds (30000ms), but you can increase it significantly for complex tasks like long todo lists."

This worked for me personally.

NellInc avatar Jul 06 '25 16:07 NellInc

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 04 '25 14:08 github-actions[bot]