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

claud-code-account-switcher

v2.2.0

Published

Manage multiple Claude Code accounts with a simple CLI

Downloads

80

Readme

Claude Account Switcher

Switch between multiple Claude Code accounts — seamlessly.

npm version Node.js License: MIT Shell: zsh/bash


What is this?

Claude Code Account Switcher lets you manage up to 5 separate Claude Code accounts on the same machine — each with its own auth, history, settings, and project data — all through the claude command you already know.

claude work        # → switch to work account and launch Claude
claude personal    # → switch to personal account and launch Claude
claude             # → launch with the currently active account

No config files to edit. No environment variables to juggle. Just type and go.


How It Works

┌─────────────────────────────────────────────────────────────┐
│  You type: claude work                                       │
│                                                             │
│  1. Shell function intercepts the command                   │
│  2. Reads active account from ~/.claude-active-account      │
│  3. Sets CLAUDE_CONFIG_DIR to that account's directory      │
│  4. Launches the real Claude binary                         │
│                                                             │
│  Result: Claude opens fully isolated to your work account   │
└─────────────────────────────────────────────────────────────┘

Each account lives in its own directory. Switching is instant.


Install

npm install -g claud-code-account-switcher

Requirements: Node.js 18+, Claude Code CLI, zsh or bash


Quick Start

Step 1 — Run setup

claude-switcher setup

The wizard handles everything:

=== Claude Code Account Switcher — Setup ===

Claude found: /Users/you/.local/bin/claude ✓

Detected existing config directories:
  ~/.claude-work      →  suggested name: work
  ~/.claude-personal  →  suggested name: personal
? Use these detected accounts? Yes

? Copy ~/.claude settings into each new account? Yes
  ✓ Cloned settings, plugins, commands (auth tokens removed)

? Which account should be active by default? work

Shell integration added to ~/.zshrc ✓

Done! Run: source ~/.zshrc
Then try: claude work

Step 2 — Apply shell changes

source ~/.zshrc

Step 3 — Start switching

claude work
# → [work]
# Claude launches with your work account

claude personal
# → [personal]
# Claude launches with your personal account

Commands

Launching Claude

| Command | Description | |---|---| | claude | Launch with the currently active account | | claude <name> | Switch to <name> and launch (e.g. claude work) | | claude<name> | Shorthand alias — e.g. claudework, claudepersonal |

Account Management

| Command | Description | |---|---| | claude who / claude /who | Show the active account and its config dir | | claude list | List all accounts — active one marked with * | | claude use <name> | Switch the active account (shows confirmation) | | claude-switcher add <name> | Add a new account without re-running setup | | claude-switcher clear-history [name] | Delete sessions and history for an account (interactive if no name given) | | claude-switcher setup | Re-run the full setup wizard |


Features

  • Auto-detection — Setup scans your home directory and pre-fills any existing ~/.claude-* directories as account suggestions
  • Config cloning — Optionally copy your current ~/.claude settings (plugins, commands, skills) into each new account. Auth tokens are always stripped — each account authenticates independently
  • Dynamic aliasesclaudework, claudepersonal, etc. are generated at shell startup from your accounts config. Add a new account and the alias is ready after source ~/.zshrc — no manual edits needed
  • Zero shell pollutionCLAUDE_CONFIG_DIR is passed only to the Claude subprocess, never exported into your shell environment
  • Idempotent setup — Running claude-switcher setup again detects the existing shell block and won't duplicate it
  • First-run auto-setup — Type claude on a fresh install with no accounts configured and setup launches automatically

Under the Hood

~/.claude-accounts.conf      # name=dir registry (one account per line)
~/.claude-active-account     # currently active account name
~/.claude-real-bin           # path to real claude binary (set at setup)

The shell function injected into your profile looks up the active account, sets CLAUDE_CONFIG_DIR, and execs the real binary — no wrappers, no subshells, no side effects.


Example: Three Accounts

claude-switcher setup        # configure work + personal
claude-switcher add client   # add a third account later

source ~/.zshrc

claude list
#     work             ->  ~/.claude-work
#   * personal         ->  ~/.claude-personal
#     client           ->  ~/.claude-client

claudeclient                 # switch to client and launch
claude who                   # Active account: client
claude use work              # switch with confirmation prompt

Troubleshooting

claude: real binary not found Run claude-switcher setup — it will locate and store the Claude binary path.

No active account Run claude-switcher setup or claude use <name> to set an active account.

Aliases not available (claudework not found) Run source ~/.zshrc to reload the shell function and regenerate aliases.

Wrong account is active Run claude who to check, then claude use <name> or just claude <name> to switch.


Changelog

v2.1.0 — Current

  • Works on Windows and WSL now. The setup wizard, account switcher, and shell integration all work natively on Windows (PowerShell) and Windows Subsystem for Linux — not just macOS and Linux.
  • PowerShell users get full support. On Windows, setup injects the claude() function into your PowerShell profile automatically — the same seamless experience bash and zsh users already had.
  • Reload hints are always right. After setup or adding an account, the command shown to reload your shell matches your actual shell — source ~/.zshrc, source ~/.bashrc, or . $PROFILE depending on what you're running.

v2.0.0

  • Every account now starts with a clean slate. When you create a new account, your conversation history and sessions stay where they belong — in the account they came from. No more cross-account bleed.
  • Want a fresh start on an existing account? Run claude-switcher clear-history and pick the account. Everything is wiped cleanly with a confirmation step so you never do it by accident.
  • Carrying history over is still possible. If you want to bring your history into a new account when setting it up, the setup wizard will ask — just say yes.

v1.2.3

  • Switch accounts in one word. Type claude work or claude personal and you're in — no config files, no env vars, no friction.
  • Setup finds your accounts automatically. If you already had multiple Claude config folders, the wizard detects them and offers to use them right away.
  • Your settings travel with you. When creating a new account, you can copy your existing settings, plugins, and commands so you don't have to set everything up from scratch.
  • Shortcuts out of the box. After setup, claudework and claudepersonal (and any other account name) work as standalone commands — no extra config needed.

License

MIT — see LICENSE


Built for developers who live in multiple Claude contexts.