Built a local proxy so my Claude Code session doesn't die when one account hits its limit

Promotion

If you're running more than one Claude subscription (or a subscription plus an API key), you've probably hit this: you're mid-task, Claude Code throws a usage-limit error, and now you have to stop, log out, log into the other account, and hope your terminal picks up where it left off.

I got annoyed enough by this that I built TeamCodex — a small local HTTP proxy that sits between Claude Code (and, separately, Codex CLI) and the actual API, and automatically routes each request to whichever of your own accounts has quota left.

A few things about how it works:

  • It doesn't round-robin. It reads each account's real rate-limit headers and drains whichever account's weekly quota resets soonest, so you're not leaving quota you already paid for to expire unused.
  • Claude Code and Codex CLI get fully separate account pools (own port, own config), so you can run both at the same time without them touching each other.
  • If a stream dies mid-response, the proxy ends it at a clean event boundary with a retryable error, so your client's automatic retry lands on another account instead of a raw "Connection closed mid-response."
  • There's a terminal dashboard (TUI) that shows quota per account and lets you reorder priority or disable an account manually.
  • Zero runtime dependencies, MIT licensed, 291 tests.

Before anyone asks — it only routes accounts you already own, from your own machine, and it doesn't let multiple people share one seat. It doesn't increase anyone's quota; it just keeps the quota you already paid for across your own accounts from sitting there unused. There's a section in the README that goes into more detail if you want it.

It's built on top of KarpelesLab/teamclaude, which handles the Claude side very well on its own — I forked it to add Codex/ChatGPT account pooling, a model fallback chain, and some network-level failover it doesn't have.

Install:

npm install -g teamcodex
teamcodex import   # or `teamcodex login` for a new account

It's MIT licensed, repo's below. I've mostly tested it against Claude Max/Pro and API-key accounts, so if you run a different mix (or hit something broken), I'd genuinely appreciate a comment or an issue.

https://github.com/sangrokjung/teamclaude

Posted Jul 29, 2026, 1:11 PM UTC

12
Loading comments…