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

cc-account-switch

v1.0.0

Published

Multi-account switcher for Claude Code - manage and switch between multiple accounts

Downloads

94

Readme

Multi-Account Switcher for Claude Code

A simple tool to manage and switch between multiple Claude Code accounts on macOS, Linux, and WSL.

Features

  • Multi-account management: Add, remove, and list Claude Code accounts
  • Quick switching: Switch between accounts with simple commands
  • Cross-platform: Works on macOS, Linux, and WSL
  • Secure storage: Uses system keychain (macOS) or protected files (Linux/WSL)
  • Settings preservation: Only switches authentication - your themes, settings, and preferences remain unchanged

Installation

Download the script directly:

curl -O https://raw.githubusercontent.com/ming86/cc-account-switcher/main/ccswitch.sh
chmod +x ccswitch.sh

Usage

Basic Commands

# Add current account to managed accounts
./ccswitch.sh --add-account

# List all managed accounts
./ccswitch.sh --list

# Switch to next account in sequence
./ccswitch.sh --switch

# Switch to specific account by number or email
./ccswitch.sh --switch-to 2
./ccswitch.sh --switch-to [email protected]

# Remove an account
./ccswitch.sh --remove-account [email protected]

# Show help
./ccswitch.sh --help

First Time Setup

  1. Log into Claude Code with your first account (make sure you're actively logged in)
  2. Run ./ccswitch.sh --add-account to add it to managed accounts
  3. Log out and log into Claude Code with your second account
  4. Run ./ccswitch.sh --add-account again
  5. Now you can switch between accounts with ./ccswitch.sh --switch
  6. Important: After each switch, restart Claude Code to use the new authentication

What gets switched: Only your authentication credentials change. Your themes, settings, preferences, and chat history remain exactly the same.

Requirements

  • Bash 4.4+
  • jq (JSON processor)

Installing Dependencies

macOS:

brew install jq

Ubuntu/Debian:

sudo apt install jq

How It Works

The switcher stores account authentication data separately:

  • macOS: Credentials in Keychain, OAuth info in ~/.claude-switch-backup/
  • Linux/WSL: Both credentials and OAuth info in ~/.claude-switch-backup/ with restricted permissions

When switching accounts, it:

  1. Backs up the current account's authentication data
  2. Restores the target account's authentication data
  3. Updates Claude Code's authentication files

Troubleshooting

If a switch fails

  • Check that you have accounts added: ./ccswitch.sh --list
  • Verify Claude Code is closed before switching
  • Try switching back to your original account

If you can't add an account

  • Make sure you're logged into Claude Code first
  • Check that you have jq installed
  • Verify you have write permissions to your home directory

If Claude Code doesn't recognize the new account

  • Make sure you restarted Claude Code after switching
  • Check the current account: ./ccswitch.sh --list (look for "(active)")

Cleanup/Uninstall

To stop using this tool and remove all data:

  1. Note your current active account: ./ccswitch.sh --list
  2. Remove the backup directory: rm -rf ~/.claude-switch-backup
  3. Delete the script: rm ccswitch.sh

Your current Claude Code login will remain active.

Security Notes

  • Credentials stored in macOS Keychain or files with 600 permissions
  • Authentication files are stored with restricted permissions (600)
  • The tool requires Claude Code to be closed during account switches

License

MIT License - see LICENSE file for details