npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-code-multi-accounts

v0.3.3

Published

Installer and CLI for switching Claude Code oauthAccount entries across Windows, WSL, and Unix shells.

Readme

Claude Code Multi-Account Switcher

npm version npm downloads

This project installs a local workaround for switching Claude Code OAuth accounts by keeping account snapshots in ~/.ClaudeCodeMultiAccounts.json and writing only the active account back into Claude's live files when switching.

Supported user-facing commands:

  • cc-switch
  • cc-switch <index>
  • cc-sync-oauth
  • ccs (short alias for cc-switch)
  • ccso (short alias for cc-sync-oauth)
  • /cc-switch
  • /cc-sync-oauth

Supported environments:

  • Windows (PowerShell/CMD/Git Bash)
  • Ubuntu WSL
  • Native macOS/Linux with Node.js
  • Claude chat shell mode via !cc-switch and !cc-sync-oauth

Prerequisites:

  • Node.js 18+
  • Claude Code already installed and logged in at least once

Install:

Recommended (via npm):

npx claude-code-multi-accounts install

Manual (from source):

git clone https://github.com/Leuconoe/ClaudeCodeMultiAccounts.git
cd ClaudeCodeMultiAccounts
./install.cmd   # Windows
./install.sh    # macOS / Linux / WSL

What install does:

  • copies the Node CLI into ~/.claude/multi-account-switch/bin
  • installs cc-switch, cc-sync-oauth, ccs, and ccso wrapper commands
  • keeps stored account snapshots in ~/.ClaudeCodeMultiAccounts.json
  • adds an auth_success hook entry to ~/.claude/settings.json
  • adds a SessionStart reminder hook to ~/.claude/settings.json
  • if statusLine.command already exists, wraps it and prepends use !cc-switch / !ccs to the existing HUD output
  • installs global Claude command wrappers in ~/.claude/commands
  • creates backups under ~/.claude/backups/multi-account-switch-installer

Uninstall:

Recommended (via npm):

npx claude-code-multi-accounts uninstall

Manual (from source):

./uninstall.cmd   # Windows
./uninstall.sh    # macOS / Linux / WSL

Usage:

cc-switch
cc-switch 1
cc-sync-oauth
ccs
ccso

Example shell output:

$ cc-switch
--- Usage ---
5h used/reset: 22.0% / 2026. 4. 2. 2:00 PM
7d used/reset: 31.0% / 2026. 4. 7. 10:00 PM

Available Claude accounts:
* [0] Alex Example <[email protected]> - Example Workspace - Pro | 5H:22%(~2h 7min) | 7D:31% (5D 10h) | synced: just now
  [1] Taylor Example <[email protected]> - Example Workspace - Teams | 5H:?(unknown) | 7D:? (unknown) | synced: never
  [2] Jordan Example <[email protected]> - Example Workspace - Enterprise | 5H:42%(~1h 10min) | 7D:51% (4D 6h) | synced: 1d ago

Run cc-switch <index> to make one of these stored entries the active Claude account.
$ cc-switch 1
Switched active account to [1] Taylor Example <[email protected]> (Teams).

Stored account list:
  [0] Alex Example <[email protected]> - Example Workspace - Pro | 5H:22%(unknown) | 7D:31% (unknown) | synced: just now
* [1] Taylor Example <[email protected]> - Example Workspace - Teams | 5H:?(unknown) | 7D:? (unknown) | synced: never
  [2] Jordan Example <[email protected]> - Example Workspace - Enterprise | 5H:42%(unknown) | 7D:51% (unknown) | synced: 1d ago

Output columns:

  • synced: When the account was last synced into the store
  • 5H: Current or cached 5-hour usage percent and reset estimate
  • 7D: Current or cached 7-day usage percent and reset estimate
  • Top usage block: live 5h used/reset and 7d used/reset values fetched from Claude when available

Claude chat shell usage:

!cc-switch
!cc-switch 1
!cc-sync-oauth
!ccs
!ccso

Claude /command usage:

/cc-switch
/cc-switch 1
/cc-sync-oauth

/cc-switch currently still goes through Claude's command-processing path, so !cc-switch remains the primary deterministic execution path. The slash command is installed now so it can benefit from future improvements in Claude's command handling.

Claude startup reminder:

Claude Code Multi-Account Switcher is available.
Use !cc-switch or !ccs to list/switch accounts.
Use !cc-sync-oauth or !ccso to sync the active account into oauthList.

Platform notes:

  • Windows installs cc-switch.cmd and cc-sync-oauth.cmd into ~/bin, plus Git Bash-friendly cc-switch and cc-sync-oauth wrappers in the same directory.
  • Short aliases ccs and ccso are installed alongside the full command names.
  • Native macOS/Linux installs commands into ~/.local/bin.
  • WSL also uses the Unix shell wrappers.
  • If a shell says command not found right after install, restart the shell or run hash -r once.

Behavior notes:

  • The tool stores metadata and credential snapshots in ~/.ClaudeCodeMultiAccounts.json.
  • cc-sync-oauth imports the current live account into that store.
  • Switching writes only the active oauthAccount back into ~/.claude.json and the active credential snapshot back into ~/.claude/.credentials.json.
  • It creates backups before writing live files or the store file.
  • Stored account ordering is stable.
  • If a stored displayName is already corrupted, output falls back to the email local part.
  • The displayed plan type is a best-effort inference from the available account fields and credential snapshot.
  • The reset: column shows rate limit countdown for the current account, or a 7-day window estimate for others.
  • Usage info from the Claude API is shown before the account list when rate limited.

Warnings:

  • This is a local workaround, not an official Claude plugin.
  • It still mutates internal Claude live files when switching accounts, but it no longer uses ~/.claude.json as the primary multi-account store.
  • Native macOS/Linux support is implemented, but still needs real-host validation beyond Windows/WSL testing.
  • npm packaging is prepared, but npm registry publish still requires npm authentication.

After this:

  • npm / npx release refresh for v0.2.5
  • non-AI hook execution path for /cc-switch if Claude exposes a direct command hook in the future
  • improve plan type detection beyond the current best-effort inference

Star History