Back to browse
GitHub Repository

Never stop coding when your AI CLI hits a rate limit. Unified wrapper for Claude Code, Codex, OpenCode, Pi with automatic fallback and context transfer.

15 starsGo

Hydra – Never stop coding when your AI CLI hits a rate limit

by saadn92·Apr 21, 2026·9 points·2 comments

AI Analysis

●●●BangerSolve My ProblemBig Brain

Automatic rate limit detection beats manually copying context between tools.

Strengths
  • PTY passthrough preserves native TUI experience of underlying CLIs
  • Context extraction copies git diff, history, and commits on provider switch
  • SIGUSR1 signaling switches ALL running sessions from any terminal
Weaknesses
  • Clipboard-based context transfer still requires manual paste step
  • Rate limit pattern detection may miss new or updated error messages
Target Audience

Developers using AI coding CLIs who hit rate limits

Post Description

I built Hydra because I kept losing my flow when Claude Code hit usage limits mid-task. I would copy context, open another tool, and then re-explain everything. This would be super annoying for me.

Hydra wraps your AI coding CLIs (Claude Code, Codex, OpenCode, Pi, or any terminal-based tool) in a single command. It monitors terminal output for rate limit patterns, and when one provider runs out, you switch to another with one keypress. Your conversation history, git diff, and recent commits are automatically copied to your clipboard so you can paste and keep going.

The fallback chain is configurable. Mine goes Claude Code → OpenCode (free Gemini) → Codex → Pi (free Gemini). The free tiers alone give you ~3000 requests/day, so even after burning through paid limits you can keep working.

Key details: Full PTY passthrough you see the exact same TUI as running the CLI directly hydra switch from another terminal signals ALL running sessions (rate limits are account-wide) Context extraction parses Claude Code's JSONL session files for real conversation history, not just recent output Any CLI that runs in a terminal works as a provider Single Go binary, ~200 lines of core logic

https://github.com/saadnvd1/hydra

Nothing amazing, but wanted to share with others in case it's useful. Feel free to modify it as you see fit.

Similar Projects

Productivity●●Solid

Claude Rate Widget Native macOS Widget to Monitor Claude Code Limits

Shows all four Claude limits (Session, Weekly, Weekly Sonnet, Overage) in one widget with color-coded warnings and reset countdowns — exactly the tiny UX gap heavy users kept bumping into. The author went native: Swift + WidgetKit, OAuth PKCE (no API keys), App Group UserDefaults for widget/app sync and a Homebrew tap for install — practical choices that make this something you'd actually run on your desktop. Limited to macOS Sonoma and Claude subscribers, so great for the audience but narrow in reach.

Niche GemSlick
hulryung
103mo ago