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

@aravhawk/cc-switch

v2.1.0

Published

Profile manager for Claude Code settings

Readme

cc-switch

Profile manager for Claude Code settings. Easily manage and switch between multiple Claude Code configurations.

Installation

npm install -g @aravhawk/cc-switch

Or with pnpm:

pnpm add -g @aravhawk/cc-switch

Usage

Interactive Mode

Run cc-switch without arguments to enter interactive mode:

cc-switch

This will present a menu with options to:

  • Show the current profile
  • Switch between profiles
  • Create new profiles
  • Delete profiles
  • Rename profiles
  • List all profiles

Command Line Mode

Actions use flags. Use a positional profile name for quick switching.

Switch Profile

cc-switch <profile-name>

Or explicit:

cc-switch --switch <profile-name>

Example:

cc-switch work

Create Profile

Create a new profile from your current ~/.claude/settings.json:

cc-switch --create <profile-name>

Example:

cc-switch --create personal

New profiles are activated immediately after creation.

Create From Provider Template

Create and apply provider defaults in one step (prompts for API key if omitted):

cc-switch --create <profile-name> --template moonshot --api-key <your-key>

Available templates:

  • anthropic (claude) – no API key needed; leaves defaults in place
  • moonshot (kimi)
  • zai (glm)
  • minimax

Templates set ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and default Haiku/Sonnet/Opus models, and remove any existing ANTHROPIC_API_KEY.

Delete Profile

Delete an existing profile (cannot delete the active profile):

cc-switch --delete <profile-name>

Example:

cc-switch --delete old-config

Rename Profile

Rename an existing profile:

cc-switch --rename <old-name> <new-name>

Or:

cc-switch --rename <old-name> --to <new-name>

Example:

cc-switch --rename work work-2024

List Profiles

List all available profiles:

cc-switch --list

Current Profile

Show the active profile:

cc-switch --current

Help and Version

cc-switch help
cc-switch --help
cc-switch version
cc-switch --version

Reserved profile names: help and version.

How It Works

cc-switch manages multiple Claude Code profiles by storing copies of your settings.json file in separate profile directories.

Data Layout

~/.cc-switch/
├── profiles/
│   ├── default/
│   │   └── settings.json
│   ├── work/
│   │   └── settings.json
│   └── personal/
│       └── settings.json
└── state.json

State File

The state.json file tracks the currently active profile:

{
  "activeProfile": "default",
  "lastSyncedAt": "2026-02-01T12:34:56.789Z"
}

Switch Behavior

When you switch profiles:

  1. The current ~/.claude/settings.json is mirrored back to the active profile's directory
  2. The target profile's settings.json is copied to ~/.claude/settings.json
  3. The active profile is updated in state.json

This ensures you never lose your current settings when switching.

Requirements

  • Node.js 18 or higher
  • Claude Code installed (with ~/.claude/settings.json present)

First-Time Setup

If you don't have a ~/.claude/settings.json file, you'll see this error:

No ~/.claude/settings.json found. Run Claude Code once to generate it,
or run the setup script provided by your provider (e.g., Z.ai).

Simply run Claude Code once to generate the initial settings file, then you can start using cc-switch.

Profile Name Rules

Profile names must:

  • Not be empty
  • Only contain letters, numbers, hyphens, and underscores
  • Not contain path separators (/, \, ..)
  • Not be reserved words (help, version)

Error Handling

cc-switch provides clear error messages for common issues:

  • Missing Claude settings file
  • Profile not found
  • Attempting to delete the active profile
  • Invalid profile names
  • Permission errors

All operations use atomic file writes to prevent data loss.

License

MIT