{"slug": "claude-account-run-two-claude-code-subscription-logins-side-by-side-and-swap-the", "title": "claude-account: run two Claude Code subscription logins side by side and swap the active one when one hits its usage cap (Linux)", "summary": "A developer created claude-account, a CLI tool for Linux that lets users run multiple Claude Code subscription logins side by side and automatically swap to a healthy account when one hits its usage cap. The tool includes a cron-based watchdog that probes the active account every 10 minutes and rotates to the next non-capped slot, with a pin feature to manually hold an account.", "body_md": "Run any number of Claude Code subscription logins side by side, switch between them, and auto-rotate to a healthy account when one hits its usage cap. Plus a one-line terminal statusline that shows which account you're on.\n\nFiles in this gist:\n\n— the CLI: hold N subscription logins, switch/rotate between them.`claude-account`\n\n— cron probe that auto-switches when the active account is capped.`claude-limit-watchdog`\n\n— bash/zsh tab-completion for the CLI.`claude-account.completion.sh`\n\n- Companion statusline (separate gist):\n[https://gist.github.com/kwadwoadu/c8278b2dc005797af6034343c1b2afa5](https://gist.github.com/kwadwoadu/c8278b2dc005797af6034343c1b2afa5)\n\nClaude Code (Linux) stores its login as a single plaintext OAuth file at\n`~/.claude/.credentials.json`\n\n, and there's no built-in multi-account support.\n\n- Conversations are\n**not** in that file. They live locally in`~/.claude/projects/<cwd>/*.jsonl`\n\n, independent of the account. Switching accounts leaves every conversation in place — there is nothing to \"port\" on one machine. - So multi-account = keep\n**named copies** of the credentials file and swap which one is live.\n\n```\nclaude-account status          # or: list   -- shows active slot + [capped Nm ago] marks\nclaude-account save <Name>     # store the current live login into a named slot\nclaude-account switch <Name>   # or: use    -- make that slot live\nclaude-account next            # rotate to the next slot (works for any number of slots)\nclaude-account pin             # pause auto-switch: hold the current account\nclaude-account unpin           # resume auto-switch\nclaude-account --help | --version\n```\n\nFirst-time setup (repeat `save`\n\nfor each account):\n\n```\ninstall -m 755 claude-account ~/.claude/bin/claude-account   # ~/.claude/bin on PATH\n# log into account A in claude (/login), then:  claude-account save accountA\n# log into account B in claude (/login), then:  claude-account save accountB\n# add a 3rd, 4th, ... the same way. flip any time:  claude-account next\n```\n\nTab-completion (subcommands + your account names):\n\n```\ninstall -m 644 claude-account.completion.sh ~/.claude/bin/claude-account.completion.sh\necho '[ -f ~/.claude/bin/claude-account.completion.sh ] && source ~/.claude/bin/claude-account.completion.sh' >> ~/.bashrc  # and/or ~/.zshrc\ninstall -m 755 claude-limit-watchdog ~/.claude/bin/claude-limit-watchdog\ncrontab -e   # add:\n*/10 * * * * ~/.claude/bin/claude-limit-watchdog\n```\n\nEvery 10 minutes it probes the **active** account with a tiny Fable call (caps are\nper-model, so a cheaper model would falsely read \"healthy\"). On a cap it marks that\nslot and rotates to the next non-capped one; it only declares **all** accounts capped\n(the `both-hot`\n\nflag) when every slot carries a fresh cap mark — never guessed from a\ntimer. The mark clears the instant an account probes healthy again.\n\n```\nevery 10 min ─▶ probe ACTIVE account\n                    │\n        ┌───────────┼─────────────┐\n      healthy      capped        error\n        │            │             │\n   clear marks   mark it,      log, wait\n   clear both-hot  rotate ─▶ next NON-capped slot ──▶ switch (verify next tick)\n                     │\n              none left? ─▶ raise both-hot flag (all subs exhausted)\n```\n\nTest it without burning quota: `WATCHDOG_FAKE_PROBE=ok|capped|error claude-limit-watchdog`\n\n.\n\n**Pinning (manual hold).** `claude-account pin`\n\npauses the watchdog on the current account\nso it won't rotate you off, even if that account is capped; `claude-account unpin`\n\nresumes.\nThe pin follows your deliberate `switch`\n\n/`use`\n\n/`next`\n\nmoves so it never points at the wrong\naccount. While pinned the watchdog does nothing at all (no probe, no rotation).\n\n- A\n**running** session keeps its OAuth token in memory, so a switch only helps**new or restarted** sessions.`claude --resume`\n\nafter a cap picks up the switched account with context intact. - After any manual\n`/login`\n\n, run`claude-account save <Name>`\n\nor the slot drifts stale. - Slot files are\n`chmod 600`\n\n, the slots dir is`chmod 700`\n\n— these are live credentials. The scripts copy credential files; they never print secrets. - Paths are overridable:\n`CLAUDE_ACCOUNTS_DIR`\n\n,`CLAUDE_CREDENTIALS`\n\n,`CLAUDE_ACCOUNT_BIN`\n\n.", "url": "https://wpnews.pro/news/claude-account-run-two-claude-code-subscription-logins-side-by-side-and-swap-the", "canonical_source": "https://gist.github.com/kwadwoadu/7ade7269dfeee6ddc4f51d19dc302c14", "published_at": "2026-07-24 15:34:21+00:00", "updated_at": "2026-07-24 18:00:30.463140+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models"], "entities": ["Claude Code", "Anthropic"], "alternates": {"html": "https://wpnews.pro/news/claude-account-run-two-claude-code-subscription-logins-side-by-side-and-swap-the", "markdown": "https://wpnews.pro/news/claude-account-run-two-claude-code-subscription-logins-side-by-side-and-swap-the.md", "text": "https://wpnews.pro/news/claude-account-run-two-claude-code-subscription-logins-side-by-side-and-swap-the.txt", "jsonld": "https://wpnews.pro/news/claude-account-run-two-claude-code-subscription-logins-side-by-side-and-swap-the.jsonld"}}