{"slug": "show-hn-limitbreak-claude-code-switches-accounts-mid-session-on-a-limit", "title": "Show HN: Limitbreak – Claude Code switches accounts mid-session on a limit", "summary": "A developer released Limitbreak, an open-source local proxy written as a single Go binary using only the standard library, that lets one Claude Code install rotate across multiple Claude accounts when an account's 5-hour or weekly usage window is exhausted. The proxy sits at 127.0.0.1:48617 between the claude client and api.anthropic.com, and only switches accounts on a 429 response carrying the anthropic-ratelimit-unified-status: rejected header, marking that account spent until its reset time and replaying the same request on the next account before Claude Code sees the error. Limitbreak requires Go 1.22+ to build, runs on macOS or Linux, sends only /v1/messages* requests on an account's token while routing connectors, MCP and artifacts through Claude Code's own credentials, and reads logins from the macOS Keychain or each ~/.claude-<name> config directory's .credentials.json.", "body_md": "\n\n```\n   ★ L I M I T   B R E A K ★\n   ADA    [██████████] LIMIT   → spent\n   GRACE  [░░░░░░░░░░] ready   → takes the hit\n```\n\nUse several Claude accounts from **one** Claude Code install, and switch between them automatically when an account's usage limit is hit, without restarting the session or losing its history.\n\nA small local proxy (a single Go binary, standard library only, a few MB of RAM) sits between `claude` and Anthropic's API. It sends each request on the active account's own login. When Anthropic answers that the account's 5-hour or weekly window is spent, the proxy remembers that account until its reset time and **replays the same request on the next account** before Claude Code ever sees the error. To the session nothing happened.\n\n```\nclaude ──ANTHROPIC_BASE_URL──▶ proxy 127.0.0.1:48617 ──▶ api.anthropic.com\n                                 │  active account's token\n                                 └─ 429 \"rejected\"? mark spent, retry on the next account\n```\n\nTry it without touching any real login: `limitbreak video` plays a simulated switch in your terminal as a little arcade battle.\n\n```\ngit clone https://github.com/radu2lupu/limitbreak && cd limitbreak\n./install.sh                                   # builds and starts the background service\necho 'source \"$HOME/.local/bin/limitbreak-shell.sh\"' >> ~/.zshrc   # or ~/.bashrc\nlimitbreak add                       # sign in another account (browser), repeat per account\n```\n\nOpen a new terminal and run `claude` as usual. When one account's limit is hit, the next one answers.\n\n- Only `/v1/messages*` requests are sent on an account's token. Everything else (claude.ai connectors, MCP, artifacts, profile) goes through untouched with Claude Code's own credentials, so those keep working.\n- It never sets `CLAUDE_CODE_OAUTH_TOKEN` (that makes Claude Code drop its connectors and local MCP servers).\n- Accounts are the logins Claude Code already holds: the default one plus every `~/.claude-<name>` config directory that has a login. Tokens are read from the macOS Keychain item Claude Code keeps per config dir, or from`<dir>/.credentials.json` . They are never copied, logged, or exposed by`GET /_status` .\n- An expired token is refreshed by running one tiny `claude -p` under that account's directory, so Claude Code stays the only thing that refreshes a login.\n- If no account can serve a request, it passes through with Claude Code's own login: never worse than no proxy.\n- Only a window rejection (`429` with`anthropic-ratelimit-unified-status: rejected` ) switches accounts. Ordinary rate limits go back to Claude unchanged.\n\nNeeds Go 1.22+ to build, macOS or Linux. Prebuilt binaries are attached to each [release](https://github.com/radu2lupu/limitbreak/releases).\n\n```\ngit clone https://github.com/radu2lupu/limitbreak\ncd limitbreak\n./install.sh          # builds, installs ~/.local/bin/limitbreak, starts a launchd / systemd user service\n```\n\nThen add the printed line to `~/.zshrc` or `~/.bashrc`:\n\n```\nsource \"$HOME/.local/bin/limitbreak-shell.sh\"\n```\n\nThat defines a `claude` function that points Claude Code at the proxy when it is running and runs plain `claude` when it is not. Use `./install.sh --binary <prebuilt>` on a host without Go.\n\n```\nlimitbreak add            # signs in a new account in your browser, names it account-N\nlimitbreak add work       # or pick the name\nlimitbreak list           # accounts, who they are, which one is active (*)\nlimitbreak remove work    # sign it out and delete its login from this machine\n```\n\n`add` runs Claude Code's own browser sign-in into its own config directory (`~/.claude-<name>`), checks the login landed, tells you which email it is, and warns if you added the same account twice. The running proxy picks it up within 30 seconds; no restart. The default account is whatever plain `claude auth login` signs in. Raw status for scripts: `curl -s http://127.0.0.1:48617/_status`.\n\nEvery switch is logged (`~/Library/Logs/limitbreak.log` on macOS, the journal on Linux): the account that ran out, when it resets, and the one now serving.\n\n`limitbreak serve --port 48617 --upstream https://api.anthropic.com --home ~ --credentials auto|keychain|file`\n\nA request path may begin with `/_c/<client>/` to give a client (an agent, a tool) its own active account; the prefix is stripped before forwarding.\n\n- **Terms of service.** This uses the official`claude` binary with accounts you own, but spreading load across subscription accounts may conflict with Anthropic's terms for your plan. Read them; you are responsible for your use. Not affiliated with or endorsed by Anthropic.\n- **Don't copy a login between machines.** Refresh tokens rotate; two machines holding the same one will log each other out. Sign in once per machine.\n- **Headless hosts.** On macOS over SSH the Keychain is locked; run the proxy as a user service in the login session (what`install.sh` does).\n- The reset time is read from Anthropic's response headers, which are not a documented contract and may change.\n\nmacOS: `launchctl bootout gui/$(id -u)/dev.limitbreak; rm ~/Library/LaunchAgents/dev.limitbreak.plist`.\nLinux: `systemctl --user disable --now limitbreak`.\nThen remove `~/.local/bin/limitbreak*` and the `source` line from your shell profile. Accounts you added stay as ordinary `~/.claude-<name>` logins; `limitbreak remove <name>` deletes one.\n\n```\ngo vet ./... && go test ./...\n```\n\nMIT, see [LICENSE](https://github.com/radu2lupu/limitbreak/blob/main/LICENSE).", "url": "https://wpnews.pro/news/show-hn-limitbreak-claude-code-switches-accounts-mid-session-on-a-limit", "canonical_source": "https://github.com/radu2lupu/limitbreak", "published_at": "2026-10-25 23:43:55+00:00", "updated_at": "2026-10-26 00:13:37.139169+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "large-language-models", "ai-agents"], "entities": ["Limitbreak", "Claude Code", "Anthropic", "Go", "macOS", "Linux", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-limitbreak-claude-code-switches-accounts-mid-session-on-a-limit", "markdown": "https://wpnews.pro/news/show-hn-limitbreak-claude-code-switches-accounts-mid-session-on-a-limit.md", "text": "https://wpnews.pro/news/show-hn-limitbreak-claude-code-switches-accounts-mid-session-on-a-limit.txt", "jsonld": "https://wpnews.pro/news/show-hn-limitbreak-claude-code-switches-accounts-mid-session-on-a-limit.jsonld"}}