cd /news/developer-tools/claude-account-run-two-claude-code-s… Β· home β€Ί topics β€Ί developer-tools β€Ί article
[ARTICLE Β· art-72426] src=gist.github.com β†— pub= topic=developer-tools verified=true sentiment=Β· neutral

claude-account: run two Claude Code subscription logins side by side and swap the active one when one hits its usage cap (Linux)

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.

read3 min views1 publishedJul 24, 2026

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.

Files in this gist:

β€” the CLI: hold N subscription logins, switch/rotate between them.claude-account

β€” cron probe that auto-switches when the active account is capped.claude-limit-watchdog

β€” bash/zsh tab-completion for the CLI.claude-account.completion.sh

Claude Code (Linux) stores its login as a single plaintext OAuth file at ~/.claude/.credentials.json

, and there's no built-in multi-account support.

  • Conversations are not in that file. They live locally in~/.claude/projects/<cwd>/*.jsonl

, independent of the account. Switching accounts leaves every conversation in place β€” there is nothing to "port" on one machine. - So multi-account = keep named copies of the credentials file and swap which one is live.

claude-account status          # or: list   -- shows active slot + [capped Nm ago] marks
claude-account save <Name>     # store the current live login into a named slot
claude-account switch <Name>   # or: use    -- make that slot live
claude-account next            # rotate to the next slot (works for any number of slots)
claude-account pin             #  auto-switch: hold the current account
claude-account unpin           # resume auto-switch
claude-account --help | --version

First-time setup (repeat save

for each account):

install -m 755 claude-account ~/.claude/bin/claude-account   # ~/.claude/bin on PATH

Tab-completion (subcommands + your account names):

install -m 644 claude-account.completion.sh ~/.claude/bin/claude-account.completion.sh
echo '[ -f ~/.claude/bin/claude-account.completion.sh ] && source ~/.claude/bin/claude-account.completion.sh' >> ~/.bashrc  # and/or ~/.zshrc
install -m 755 claude-limit-watchdog ~/.claude/bin/claude-limit-watchdog
crontab -e   # add:
*/10 * * * * ~/.claude/bin/claude-limit-watchdog

Every 10 minutes it probes the active account with a tiny Fable call (caps are per-model, so a cheaper model would falsely read "healthy"). On a cap it marks that slot and rotates to the next non-capped one; it only declares all accounts capped (the both-hot

flag) when every slot carries a fresh cap mark β€” never guessed from a timer. The mark clears the instant an account probes healthy again.

every 10 min ─▢ probe ACTIVE account
                    β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      healthy      capped        error
        β”‚            β”‚             β”‚
   clear marks   mark it,      log, wait
   clear both-hot  rotate ─▢ next NON-capped slot ──▢ switch (verify next tick)
                     β”‚
              none left? ─▢ raise both-hot flag (all subs exhausted)

Test it without burning quota: WATCHDOG_FAKE_PROBE=ok|capped|error claude-limit-watchdog

.

Pinning (manual hold). claude-account pin

s the watchdog on the current account so it won't rotate you off, even if that account is capped; claude-account unpin

resumes. The pin follows your deliberate switch

/use

/next

moves so it never points at the wrong account. While pinned the watchdog does nothing at all (no probe, no rotation).

  • A running session keeps its OAuth token in memory, so a switch only helpsnew or restarted sessions.claude --resume

after a cap picks up the switched account with context intact. - After any manual /login

, runclaude-account save <Name>

or the slot drifts stale. - Slot files are chmod 600

, the slots dir ischmod 700

β€” these are live credentials. The scripts copy credential files; they never print secrets. - Paths are overridable: CLAUDE_ACCOUNTS_DIR

,CLAUDE_CREDENTIALS

,CLAUDE_ACCOUNT_BIN

.

── more in #developer-tools 4 stories Β· sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/claude-account-run-t…] indexed:0 read:3min 2026-07-24 Β· β€”