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

@futura-research/claude-switch

v1.1.0

Published

Switch between multiple Claude Code accounts with named profiles

Downloads

213

Readme

claude-switch

Maintainability Code Coverage

Switch between multiple Claude Code accounts with named profiles.

If you use Claude Code with more than one Anthropic account (e.g. work + personal), claude-switch eliminates the constant log out / log in cycle by giving each account its own isolated config directory.

Install

npm install -g @futura-research/claude-switch

Or run directly:

npx @futura-research/claude-switch --help

Quick Start

# Create profiles (launches Claude Code auth for each)
claude-switch add work
claude-switch add personal

# Launch Claude with a specific profile
claude-switch --work
claude-switch --personal --dangerously-skip-permissions

# Check which profile would be used
claude-switch which

Usage

Launch Claude with a profile

claude-switch --<profile> [any claude flags...]

Everything after the profile flag is passed straight through to claude.

claude-switch --work -p "fix the tests"
claude-switch --personal --dangerously-skip-permissions

Auto-detect from directory

When no --<profile> flag is given, claude-switch checks directory rules, then falls back to the default profile:

claude-switch                          # uses rule match or default
claude-switch --dangerously-skip-permissions  # same, with flags

Profile management

claude-switch add <name>             # Create profile + authenticate
claude-switch add <name> --no-copy   # Create profile without copying existing settings
claude-switch remove <name>          # Remove a profile and delete its config directory
claude-switch remove <name> --keep-dir  # Remove but keep the config directory on disk
claude-switch list                   # List all profiles
claude-switch default <name>         # Set the default profile

When you create a profile, claude-switch asks whether to copy your existing Claude config and — if yes — which categories to include:

$ claude-switch add work
  Copy existing Claude settings to new profile? (Y/n)

  What would you like to copy?

  Settings — Theme, model, and general preferences (Y/n)
  Skills & commands — Custom skills, slash commands, and plugins (Y/n)
  IDE settings — VS Code / JetBrains integration config (Y/n)
  Conversation history — Resume sessions and command history (y/N)
  In-progress work — Plans, tasks, and todos (y/N)

Auth credentials (oauthAccount) are always stripped from the copied config — the new profile will prompt for its own login. Use --no-copy to skip all prompts and create a completely clean profile.

Copy, reset & duplicate

Manage profile config state at any time:

claude-switch copy-config <name>             # Copy base Claude config into a profile
claude-switch reset <name>                   # Wipe a profile's config (keeps profile registered)
claude-switch duplicate <source> <new-name>  # Clone a profile under a new name

Copy config prompts for the same category selection as add, then copies only the chosen items from ~/.claude into the profile. Auth credentials are stripped automatically.

claude-switch copy-config work

Reset wipes the profile directory clean but keeps it registered — you can then re-authenticate or copy config back in:

claude-switch reset work          # clean slate
claude-switch copy-config work    # restore from base config

Duplicate creates a new profile that's an exact clone of an existing one — all data including auth is preserved, and .git directories inside plugins are excluded to avoid permission errors:

claude-switch duplicate work work-staging

Shared project history

All profiles share a single projects/ directory at ~/.claude-switch/shared/projects/. This avoids duplicating the 1GB+ of conversation history that Claude stores per directory.

The symlink is created automatically on first launch or profile creation. Existing profiles that already have a real projects/ directory are left untouched.

Directory rules

Map directories to profiles for automatic switching:

claude-switch rule add ~/work/repos work
claude-switch rule add ~/personal personal
claude-switch rule list
claude-switch rule remove ~/work/repos

When you run claude-switch inside ~/work/repos/my-project, it automatically uses the work profile (longest directory prefix match wins).

Shell alias (recommended)

Add to your ~/.zshrc or ~/.bashrc:

alias claude="claude-switch"

Then:

claude --work
claude --personal --dangerously-skip-permissions
claude                    # auto-detects from directory

How it works

claude-switch --<profile> [claude flags...]
       │
       ├─ Looks up <profile> in ~/.claude-switch/config.json
       ├─ Sets CLAUDE_CONFIG_DIR to the profile's config directory
       ├─ Spawns: claude [claude flags...]
       └─ Inherits stdio (fully interactive)

Resolution order:

  1. --<profile> flag (if it matches a known profile name)
  2. Directory rules (longest prefix match)
  3. Default profile

Config is stored at ~/.claude-switch/config.json. Each profile gets its own directory under ~/.claude-switch/profiles/<name>/.

Requirements

License

Apache 2.0 + Commons Clause — free to use, modify, and include in your projects with attribution to Futura Research. Not for resale. See LICENSE for details.

Contributing

See CONTRIBUTING.md for development setup, branching conventions, and code quality standards.