Related ToolsClaude CodeClaudeAiderCursorCody

Open-Source "Relay" Hands Claude Code Sessions Off to Gemini or Codex at Rate Limits

Claude by Anthropic
Image: Anthropic

Claude Code's rate limits are a real friction point for anyone doing long coding sessions. You hit the cap mid-task, the session ends, and you're left choosing between waiting hours for the limit to reset or starting over with a manually reconstructed prompt. A developer built an open-source tool called Relay to handle the handoff automatically.

When Claude Code hits a rate limit, Relay captures the full session context - the problem being solved, the files being modified, the conversation history - and transfers it to whichever AI coding tool you've configured as a fallback. Current options are OpenAI's Codex CLI, Google's Gemini CLI, and Aider (an open-source coding assistant that works with most major AI models). The receiving tool picks up with full awareness of what was already done.

Without something like Relay, hitting a rate limit mid-task means losing that context entirely. Claude Code doesn't serialize your session state - once the limit hits, that conversation is gone. For a 30-minute debugging session or a multi-file refactor, that's a meaningful loss.

Relay is available on GitHub and works with Claude Code's existing CLI setup. The main requirement is having API credentials configured for your backup tool before you need them - not something to figure out mid-session.

The project doesn't eliminate rate limits. Claude Code's usage caps still exist. But for developers who regularly push into those limits, being able to continue working without stopping removes most of the practical frustration.