Run Claude Code on more than one account
Claude Code keeps one login. If you have a work seat and a personal plan, you sign in and out all day to use both. And when the five-hour window runs out, you wait for it. zclaude runs your accounts side by side, shows what is left on each, and can carry one session across them, so work continues on the next account instead of stopping.
curl -fsSL https://gramini-tech.github.io/zclaude/install | bash
macOS or Linux. Brings Node.js only if yours is older than 20.17, and installs Claude Code if you do not have it.
npx github:gramini-tech/zclaude self-install
Node.js already installed. Drop self-install to run it once and keep nothing.
npm install -g github:gramini-tech/zclaude
A regular global install. This is the one to use on Windows.
git clone https://github.com/gramini-tech/zclaude.git && cd zclaude && npm install && ln -s "$PWD/zclaude" ~/.local/bin/zclaude
Work from a clone. The bash runner finds a suitable Node on its own.
Then open a new terminal and type zclaude.
The thing it fixes
// today $ claude … ✗ 5-hour limit reached. Resets at 7:50 pm. You have a personal plan too. Using it means signing out of work, and back in tomorrow. $ (two hours of waiting)
// with zclaude $ zclaude work … work's window fills up mid-task … and it keeps going $ zclaude router log 19:32 200 opus any→work 8129ms 19:41 200 opus any→personal 7204ms
Same session, same terminal, no restart. The request that would have failed went to your other account instead.
What people use it for
Two accounts, both live
A company seat in one terminal, your personal plan in another, at the same time. Each gets its own login and
its own config directory. The account you were already signed into carries on working in VS Code and in plain
claude.
zclaude profile add work # sign in, once
zclaude work # terminal one
zclaude personal # terminal two
Carry on past a limit
Turn the router on and a session picks an account for every request instead of once at startup. When one account's window fills, the next request goes to another. You do not restart anything, and you do not lose the conversation.
zclaude router on
zclaude work
Send the small work somewhere cheaper
Subagent turns, file searches and summaries do not need your most expensive model. Point that class of work at a Z.ai GLM Coding Plan and keep the hard reasoning on Anthropic. Your Claude window then lasts through a lot more work.
zclaude router route haiku glm-fast # helpers go to GLM
zclaude router route sonnet glm any # subagents too, then fall back
zclaude router route opus work # the hard turns stay on Claude
Know what is left before you start
Claude Code says nothing about your remaining quota until it stops you. This is every account's five-hour window, its week, each model metered separately, and the time each one comes back in your own zone.
$ zclaude profile list --usage
work anthropic you@company.com · Acme Inc
5 hours 80% resets in 2h 30m (07:50 pm)
week 21% resets in 6d 7h (Thu, 24 Sept, 12:30 am)
Fable week 33% resets in 6d 7h (Thu, 24 Sept, 12:30 am)
personal anthropic you@gmail.com · personal
5 hours 3% resets in 4h 10m (09:30 pm)
week 12%
The same table is in the menu while you pick a profile, and in a VS Code status bar item that switches accounts from a hover.
How the routing works
A small proxy runs on 127.0.0.1 for the length of a session. Every request Claude Code sends
already says which class of model it wants, so the router reads that, looks it up in a table you control, and
sends it to the account or provider named there.
$ zclaude router status mode session serving http://127.0.0.1:34317 opus work then any sonnet glm then any haiku glm-fast (pinned) fable any
$ zclaude router log 19:41:07 200 opus any→personal 7204ms 2 tries 19:32:45 200 sonnet any→work 3454ms 19:32:45 200 sonnet any→personal 1380ms 19:31:02 200 haiku glm-fast→zai 412ms 19:30:51 200 opus work→work 8129ms
Left of the arrow is the entry in your table, right of it is the account that answered. The top line took two
tries: work came back rate limited, so the request went to personal and the user saw
an answer rather than an error. The two at 19:32:45 are separate sessions running at once.
It tells apart the two kinds of rate limit. When a window is spent the request moves to the next account. When
it is just too many requests in a minute it waits a second and asks the same account again, because moving
would throw away the prompt cache, which is most of what an agent turn costs. No model version appears in the
table: a Z.ai target says latest or latest:fast, resolved against what the provider
publishes at the moment you send the request.
Also in the box
-
A status bar item for VS Code
Shows the signed-in account and every plan's usage. One click moves the global login. Installs into VS Code, Insiders, Cursor, Windsurf and VSCodium.
-
What is already running
zclaude sessionslists the sessions on this machine and which account each is spending, so you do not start a third one on an account two are already using. -
Logins that do not go stale
A scheduled job refreshes a profile's token before it lapses, so an account you open twice a term is still signed in when you come back to it.
-
A switch for the whole machine
zclaude switch workmoves the one login plainclaudeand the extension share. Backed up first, and--restoreputs it back. -
Straight answers when something is off
zclaude profile doctornames a shell that pins a config directory, a share that came unlinked, and any employer policy no profile can escape. -
Updates itself
A daily check tells you when a new version is out.
zclaude self-updateinstalls it the same way you installed it.
The commands you will actually type
zclaude |
Menu of your profiles, with usage, then launch. |
zclaude work |
Skip the menu. Anything after the name goes to claude. |
zclaude profile add |
Set up another account and sign in to it. |
zclaude profile list --usage |
Every account, with what is left on each. |
zclaude router on |
Route the sessions you start. router off stops. |
zclaude router route sonnet glm |
Send a class of model somewhere. One target pins it there. |
zclaude router log |
Where each request went. Metadata only. |
zclaude router open |
A page on loopback to edit the table and watch the log. |
zclaude switch work |
Move the machine's login. switch --restore undoes it. |
zclaude sessions |
What is running now, and on which account. |
zclaude models |
What each provider publishes today, asked live. |
zclaude profile doctor |
Check every profile and this shell. |
zclaude -- --help |
Claude Code's own help. zclaude --help shows zclaude's. |
What it does not do
- It does not get you more quota. It uses the plans you already pay for, and it makes the ones you have easier to use together. If you only have one account, the usage display and the VS Code item are still worth having; the routing is not.
-
Routing covers the sessions you start with zclaude. Plain
claude, your editor and anything else on the machine go straight to Anthropic as before. Routing everything would mean writing your Claude Code settings and making a local process something every editor window depends on. That is designed and not built. -
It never logs your prompts. The router records the class, the account, the model id, the
status, the duration and the token counts. No prompts, no responses, no flag that changes it. The page that
shows them binds to
127.0.0.1only. - macOS and Linux are the tested platforms. Windows works through the npm install; the scheduled token renewal is something you set up yourself there.
- It is not made by Anthropic or Z.ai. Independent, MIT licensed, and it uses the environment variables Claude Code documents plus the browser sign-in Z.ai's own desktop app uses.
Questions
How can two accounts run at the same time?
Claude Code reads its configuration from CLAUDE_CONFIG_DIR and stores its login keyed by that
directory. zclaude gives each profile a directory and sets the variable for the one process it starts, so
each terminal has a login of its own. It never sets the variable for your default account, because Claude
Code treats the variable being set at all, whatever its value, as a different account.
Will this sign me out of VS Code?
No. The extension uses your default login, which adding a profile and signing in to it never touch. The one
thing that moves it is zclaude switch, which you ask for by name and can undo with
zclaude switch --restore.
Is this against Anthropic's terms?
It runs accounts you pay for, one session at a time each, on your own machine. It does not share a subscription between people, resell access, or use the API on a plan that does not include it. If your employer's seat has rules about where it can be used, those still apply; zclaude does not change them.
What happens when an account runs out mid-session?
The next request goes to the next account in that class's list, and the spent one sits out until its window resets. If nothing in the list can take it, the request waits quietly for up to four minutes and then comes back as a normal rate-limit error that Claude Code already knows how to retry. Nothing is written to the response until an upstream has answered, so a request either succeeds or fails cleanly.
Does a routed session lose the conversation?
No. The conversation lives in Claude Code, not in the router, and every request carries it. Moving accounts does cost the prompt cache on the new one, so the router keeps a conversation on the account it started on for five minutes and only moves it when that account cannot take the next request.
Do I have to keep the route table up to date with new models?
No, and it is built to stop you trying. Routes are written against the class of model, so a model released
tomorrow is routed correctly with no edit. A Z.ai target names latest or
latest:fast and is resolved against what the provider publishes when the request goes out.
zclaude models shows what each one means today.
I use one email for a company seat and a personal plan. One profile or two?
Two. They are separate organizations with separate billing and separate usage, and Claude Code stores them
as different logins. zclaude profile list prints the organization after the address, so the
company name and personal tell the two rows apart.
Does it change my Claude Code settings?
It never writes ~/.claude/settings.json or your project's .claude folder. It reads
them, to set a new profile up like your normal one and to warn you about an env block that
would override a session. The exception is the switch you ask for by name, which replaces the stored
credential and one key of ~/.claude.json, both backed up and both restorable. A test hashes the
directory before and after a run.
Can I share my skills and commands with a new profile?
That is the default. Agents, commands, skills, rules, output styles, workflows, themes and
CLAUDE.md are linked to your originals, so edits follow. Your settings.json is
copied through a filter that drops anything holding a credential. --share none gives you a
clean profile instead.
Where are my credentials kept?
Anthropic logins are stored by Claude Code itself, in the macOS Keychain, one item per profile. zclaude
reads one only to move it where you asked or to ask how much quota is left. A Z.ai key goes in the Keychain
under the service name zclaude, written over stdin so it never appears in a process listing. On
Linux, both fall back to a 0600 file inside the profile.
What do I need to run it?
A Mac or a Linux machine and Claude Code. The curl installer adds Claude Code if it is missing, and Node.js only if yours is older than 20.17. Routing to GLM models needs a Z.ai Coding Plan; everything else works with Claude accounts alone.
How do I remove it?
zclaude self-uninstall, or
curl -fsSL https://gramini-tech.github.io/zclaude/install | bash -s -- --uninstall if the
command is already gone. It takes out zclaude, the scheduled renewal and the VS Code item. Note that it also
signs every profile out, because each profile's login lives outside ~/.zclaude and has to be
removed by name; --keep-config keeps the profiles and their logins. Your original Claude Code
account is untouched either way.
Something went wrong. Where do I look?
Every run writes a redacted JSON log and the error line tells you its path. zclaude log opens
the last one, --json makes it easy to attach to an issue, and secrets are masked in every line
before anything is written.