[BUG] API Error (Request timed out.) · Retrying in 35 seconds… (attempt 9/10)
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
- While compacting
- none
- 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.
the problem is "env": { "MAX_THINKING_TOKENS": "32000" } , remove it
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.
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.