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  5H USED
1.    home  me@gmail.com    max   12%
2. *  work  me@company.com  team  96%

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; --probe when the API is throttled
hop next hop to the login with the most 5-hour room, from a list you set once
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. It renews an idle account's aged-out access token first, so every account can be read, not only the one you are on. When the endpoint still will not answer, --probe takes the figures from one one-word claude -p reply sent as that account. hop list --verify similarly remembers identity lookups for 60 seconds (never storing tokens). --no-cache / --fresh bypasses the cache for both commands. Nothing polls in the background.

$ hop usage
   NAME   5 HOURS                 7 DAYS               NOTE
   home   0%  reset, was 98%      61%  resets 4d23h
*  work   42%  resets 2h14m       18%  resets 3d4h
   team   71%  resets 3h02m       29% Fable  resets 6d  read through claude

The login with room. hop next a b c hops to whichever of those logins has the most of its 5-hour window left, and remembers the list, so later a bare hop next does it. A login it has no current figure for is read first, so it never picks on an old reading. It is a command you run, not something that switches by itself.

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. hop usage --probe and hop next also hand an access token to your own claude command, in its environment, for one request. 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 280 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.9.0

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.9.0
File Size Uploaded
claudehop_cli-1.9.0.tar.gz 98.5 kB Details

Built distribution (wheel)

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

Total release size: 140.4 kB

Release files / claudehop_cli-1.9.0.tar.gz

Download URL claudehop_cli-1.9.0.tar.gz
Size 98.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9ed06eb4203978b0614b828db720a9b9953f67e63fd549bcc71b6402d3318f58
BLAKE2b-256 checksum
How to use checksums
a5d92bd3904138583732925f8bb8cab0267af960e98a51c1a57745fbf7c8b5cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

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

Download URL claudehop_cli-1.9.0-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01070e17e9b16b985f55b63a7c2ba671b70cef6a2e42c935f30bcdc146c52cdb
BLAKE2b-256 checksum
How to use checksums
d2fcaf77dfa603dd2bd3b06ec6da2dc305cd6d7983f2a41ad9fd0611d7ea5e4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.9.0 This release

2 release files

1.8.0

2 release files

1.7.2

2 release files

1.7.1

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