zclaude

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

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.

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

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

Install it Read the source Full documentation

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.