API timeout after successful tool execution in v2.1.6
Resolved 💬 6 comments Opened Jan 13, 2026 by jyongchul Closed Mar 1, 2026
Claude Code Bug Report: API Timeout After Successful Tool Execution
Summary
Claude Code 2.1.6 intermittently fails with "Request timed out" errors after successfully executing tools, suggesting an API communication issue rather than tool execution failure.
Environment
- Claude Code Version: 2.1.6
- OS: Ubuntu on WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2)
- Concurrent Sessions: 13 Claude Code sessions running simultaneously
- Network: Verified working (0.6-0.7s latency to api.anthropic.com)
Observed Behavior
Error Pattern
- ✅ Tool executes successfully (e.g., Playwright MCP returns "Scrolled to top")
- ✅ PostToolUse hook succeeds (hook processing completes normally)
- ❌ API communication fails with "Request timed out"
- 🔄 Retry loop begins (attempt 6/10, 7/10, etc.)
Example Error Sequence
✅ plugin:playwright:playwright - Run Playwright code (MCP)
Result: "Scrolled to top"
✅ PostToolUse:mcp__plugin_playwright_playwright__browser_run_code hook succeeded: Success
❌ Request timed out. Check your internet connection and proxy settings
Retrying in 13 seconds… (attempt 6/10)
Frequency
- Occurs intermittently (not every request)
- More frequent with:
- Multiple concurrent sessions (13 observed)
- Repeated tool calls in short succession
- MCP tools (Playwright, Chrome DevTools, etc.)
Evidence Against Common Causes
❌ Not a Network Issue
Direct API connectivity test shows consistent performance:
$ for i in {1..10}; do curl -s -o /dev/null -w "Time: %{time_total}s\n" https://api.anthropic.com; done
Time: 0.617s
Time: 0.610s
Time: 0.730s
Time: 0.604s
Time: 2.811s # Occasional spike
Time: 0.637s
...
Average latency: 0.6-0.7s (well within timeout threshold)
❌ Not a Tool Execution Issue
- Tools complete successfully before timeout
- Tool results are returned correctly
- Hooks process results without errors
- Problem occurs during API result transmission
❌ Not a Resource Issue
System resources are adequate:
- Server has sufficient CPU/Memory
- Previous versions handled 15+ sessions without issues
- User reports this is a recent degradation
Suspected Root Cause
API Communication Logic Regression in Claude Code 2.1.6
Possible causes:
- Rate limiting threshold lowered on Claude API side
- Timeout configuration too aggressive in 2.1.6
- Connection pooling issue with concurrent sessions
- Response handling bug when processing tool results
Reproduction Steps
- Start 10+ Claude Code sessions simultaneously
- Use MCP tools repeatedly (Playwright, Chrome DevTools, etc.)
- Observe intermittent "Request timed out" errors
- Note that errors occur after tool success
Expected Behavior
- API timeouts should not occur when tool execution succeeds
- If rate limiting is the issue, should fail before tool execution
- Retry logic should distinguish between tool failure and API failure
Suggested Investigation
- Check Claude API rate limiting changes in recent deployments
- Review timeout configuration in 2.1.6 vs previous versions
- Examine API client connection pooling logic
- Add telemetry to distinguish tool errors from API errors
Workaround
- Reduce concurrent sessions to 3-5 (mitigates rate limiting)
- Use direct Bash tools instead of MCP when possible
- Wait longer between tool calls
Additional Context
- Related to GitHub Issue #15945 (MCP process lifecycle)
- User reports this worked fine previously with more sessions
- Issue manifests across multiple MCP servers (not Playwright-specific)
User Quote
"I think Claude Code has degraded in performance. This problem is not caused by running many Claude Code CLI instances. Previously, we operated much more instances without issues, and our server has sufficient resources."
---
Reported by: Server2Maintenance project user
Date: 2026-01-13
Impact: High (blocks normal workflow with multiple sessions)
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗