When Claude Code encounters transient API errors (500 Internal Server Error, 529 Overloaded), there's no way for users to configure retry behavior.
Proposed solution
Add environment variables or settings to control:
CLAUDE_CODE_API_RETRIES - max retry attempts (default: 3)
CLAUDE_CODE_RETRY_DELAY_MS - initial backoff delay (default: 1000)
CLAUDE_CODE_RETRY_BACKOFF - exponential backoff multiplier (default: 2)
Use case
During periods of API instability, users hit repeated 500 errors that interrupt workflows. Configurable retries would allow Claude Code to recover automatically from transient failures without user intervention.
Additional context
Ironically, while researching whether this feature already existed, I encountered multiple 500 errors from the API - which would have been handled gracefully if this feature existed.
When Claude Code encounters transient API errors (500 Internal Server Error, 529 Overloaded), there's no way for users to configure retry behavior.
Proposed solution
Add environment variables or settings to control:
CLAUDE_CODE_API_RETRIES- max retry attempts (default: 3)CLAUDE_CODE_RETRY_DELAY_MS- initial backoff delay (default: 1000)CLAUDE_CODE_RETRY_BACKOFF- exponential backoff multiplier (default: 2)Use case
During periods of API instability, users hit repeated 500 errors that interrupt workflows. Configurable retries would allow Claude Code to recover automatically from transient failures without user intervention.
Additional context
Ironically, while researching whether this feature already existed, I encountered multiple 500 errors from the API - which would have been handled gracefully if this feature existed.