Skip to main content

claudehop: use several Claude Code accounts on one machine

claudehop

Use several Claude Code accounts on one machine.
Move every terminal to another login in one keystroke, or give each terminal its own account.
One file, no dependencies, no background process.

PyPI CI Licence: MIT Python 3.9+ No dependencies

Install · Why claudehop · Commands · FAQ · Changelog · Security


Two commands cover it.

hop work                    # every open claude moves to the work account, on its next message
hop run home -- --resume    # claude as the home account in this terminal only

hop swaps the saved login. hop run gives one terminal its own account and leaves your other terminals alone, so a Max account in one terminal and a Team seat in another each spend their own usage pool. Neither opens a browser.

$ hop
      NAME  EMAIL           PLAN
1.    home  me@gmail.com    max
2. *  work  me@company.com  team

hop to which? [1-2, Enter to stay] 1
switched to home (me@gmail.com, max)

Install

pipx install claudehop-cli          # or: pip install --user claudehop-cli
eval "$(claudehop shell-init)"      # the `hop` alias and tab-completion

Put the eval line in your ~/.bashrc or ~/.zshrc and open a new terminal. hop and claudehop are the same command. The package name carries a -cli suffix because PyPI holds the bare name too close to an unrelated project; the commands don't. It needs Python 3.9 or newer and Claude Code, on Linux or macOS. To install from a clone instead, run ./install.sh.

Then save the login you already have, and add the others:

hop save home        # names whatever is logged in right now
hop add work         # logs in as a second account and saves it

Why claudehop

claudehop is the smallest tool that does this job, and the one that plans your monthly re-login. It does less than its two big alternatives on purpose, and where they go further the table says so.

claudehop claude-swap clauth
Size of the tool 97 KB 1.2 MB 15.7 MB
Extra packages none 10 none
Time to start 22 ms 71 ms not measured
Account per terminal yes yes yes
History across accounts shared opt in browse
Bedrock, Vertex, gateway yes API keys endpoints
Login about to expire warns early when dead when expired
Background process never optional optional
Switches by itself no yes yes
Terminal interface no yes yes
Windows no yes yes

Size is the tool's own code: claudehop is one file, claude-swap is 24,400 lines and clauth is a compiled binary. The cells are short on purpose; the comparison page spells each one out.

A switcher holds your refresh tokens, so a tool you can read in one sitting is a security property, not only a size. The 30-day login window is the other gap: an account's refresh token dies 30 days after the login that issued it, and renewing does not move that date. hop doctor works out the day the earliest account comes due and tells you to log them all in then, so they share one date from then on. Neither alternative's README mentions it. Every number, how it was measured and what the others do better is on the comparison page.

Commands

Command What it does
hop pick an account from a menu
hop <name> move every open claude to that account's login
hop run <name> [claude args] claude as that account in this terminal only
hop add <name> · hop save <name> log in as a new account · save the login you have
hop usage 5-hour and 7-day usage per account, when each resets
hop provider <name> <command> · hop off Bedrock, Vertex or a gateway, hopped to like an account
hop doctor check the setup and the next re-login date; --fix repairs what it can
hop renew · hop whoami · hop rm · hop rename keep the saved logins current and tidy

--json on list, whoami, active, usage and doctor gives output with no secrets in it, for scripts and statuslines. The full reference is in docs/commands.md.

One account per terminal. hop run work points claude at a config home of its own, so your other terminals keep their account. Your settings, skills, agents, plugins, CLAUDE.md, prompt history and projects are linked in, so the session looks like your normal one and conversations and memory are shared across accounts. The renewed login is saved back when the session ends. Linux only for now.

Usage. hop usage reads the usage endpoint that Claude Code itself calls. It limits other clients, so hop usage asks only when you run it, remembers the last good reading, and waits out the server's Retry-After. Nothing polls in the background.

$ hop usage
   NAME   5 HOURS            7 DAYS             NOTE
   home   98%  resets 24m    61%  resets 4d23h
*  work   42%  resets 2h14m  18%  resets 3d4h

Before you hop

  • A hop moves every running claude, not only new ones. Claude Code reads its login again before each message, so a conversation under way changes account on its next message and starts a new prompt cache. Use hop run when you want two accounts at once.
  • Paste the /login URL into a private browser window. Your normal browser is already signed in as one of your other accounts and will authorise that one without asking.
  • ANTHROPIC_API_KEY and CLAUDE_CODE_OAUTH_TOKEN in the environment override the saved login. hop whoami and hop doctor warn when either is set.
  • Each account keeps its own rate limits and terms. This moves your own logins between your own terminals. It is not a way to pool quota.

FAQ

How do I use two Claude Code accounts on one machine? Install claudehop, run hop save home while logged in to the first account, then hop add work for the second. After that hop work and hop home switch between them without a browser.

Can two terminals use two different accounts at the same time? Yes, with hop run <name>. A plain hop cannot, because Claude Code reads its login again before every message, so a hop reaches every open session. hop run gives one terminal its own config home and leaves the others alone.

Does switching sign me out of my MCP servers? No. The credential store holds your MCP logins under their own key, and claudehop swaps only the Claude login block.

Does it work with Bedrock, Vertex or a gateway? Yes. Write a small launcher that sets the environment variables and runs claude "$@", register it with hop provider, and hop <name> sends new claude commands through it. Your saved logins are never touched.

Where are my tokens, and where do they go? In ~/.claude/accounts/, a folder only you can open, with each file private to you. Tokens go only to Anthropic: api.anthropic.com to learn who you are and your usage, and platform.claude.com to renew one. SECURITY.md has the threat model.

How does it work, and how do I know it is right? claudehop keeps one saved copy of each login and swaps the live one in and out while holding Claude Code's own refresh lock. Every claim about Claude Code's behaviour was measured and names the version it was measured on; the experiments and the 30-day login window are in docs/how-it-works.md. The roughly 240 checks in test/test-switch.sh run against fake logins with no network.

How does it differ from claude-swap or clauth? It is smaller, starts faster, plans your monthly re-login and has no background process. They add automatic switching, a terminal interface and Windows support. The comparison page has the numbers and the method.

Contributing and licence

Issues and pull requests are welcome; start with CONTRIBUTING.md, and see the open issues for places to help, including macOS support for hop run. Ask questions in Discussions. If claudehop saved you a browser round-trip this morning, a star on GitHub helps others find it.

MIT licence. Not affiliated with, endorsed by, or sponsored by Anthropic. "Claude" and "Claude Code" are trademarks of Anthropic, PBC, used here only to say what this works with.


Made by Ebenworks

Metadata

Release files for claudehop-cli 1.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claudehop-cli 1.7.1
File Size Uploaded
claudehop_cli-1.7.1.tar.gz 81.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claudehop-cli 1.7.1
File Interpreter ABI Platform
claudehop_cli-1.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 116.7 kB

Release files / claudehop_cli-1.7.1.tar.gz

Download URL claudehop_cli-1.7.1.tar.gz
Size 81.1 kB
Tags Source
SHA-256 checksum
How to use checksums
26a6b0b09f4fa5390d3906372e3f9b807aedf8560d0ae3a14c33b4a3d1eefc10
BLAKE2b-256 checksum
How to use checksums
a7ec12efcbfadcb1af0190393c71a257830c83aefe37345544f0be03bca50301
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / claudehop_cli-1.7.1-py3-none-any.whl

Download URL claudehop_cli-1.7.1-py3-none-any.whl
Size 35.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d834a07d99e1dcaa63d78a3c3ad58f324891bd52769dc0c980c827b9ec2e6693
BLAKE2b-256 checksum
How to use checksums
8baeabf1e52e2f79b667722ef4b5ba16856b8399ceca56844d71fdebc6044fc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.7.2

2 release files

This release

1.7.1 This release

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page