Add configurable retry behavior for API errors (500, 529, etc.)

Resolved 💬 5 comments Opened Feb 4, 2026 by wmatson-skyslope Closed Mar 5, 2026

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.

View original on GitHub ↗

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