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-model-switch

v2.2.0

Published

Launch Claude Code with preconfigured model environments

Readme

Claude Code Model Switch (CCMS)

A CLI tool for switching between different AI models in Claude Code.

🚀 Features

  • Launch Claude Code with a preconfigured model in one command (yolo mode)
  • Support for multiple pre-configured model environments
  • start injects model config as env vars; config persists to settings.json
  • shared env vars apply to all models (model-specific values override shared)
  • Automatic handling of model-related environment variables and defaults
  • Simple command-line interface
  • unset removes model-related entries from settings.json

📦 Installation

npm install -g claude-code-model-switch

🛠️ Usage

Basic Commands

# Launch Claude Code with the specified model (yolo mode enabled)
ccms start deepseek-chat

# Pass extra arguments directly to claude
ccms start deepseek-chat -p "hello"

# Write model configuration to ~/.claude/settings.json
ccms config deepseek-chat

# List all available models
ccms list

# Show configuration file paths
ccms config-path

# Remove model-related configuration from settings.json
ccms unset

# Manage shared environment variables for all models
ccms shared list
ccms shared set API_TIMEOUT_MS 600000
ccms shared unset API_TIMEOUT_MS

Model Configuration

Edit the configuration file ~/.claude-code-model-switch/settings.json:

{
  "shared": {
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "API_TIMEOUT_MS": "600000"
  },
  "models": {
    "deepseek-chat": {
      "ANTHROPIC_AUTH_TOKEN": "sk-your-token-here",
      "ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
      "ANTHROPIC_MODEL": "deepseek-chat",
      "ANTHROPIC_SMALL_FAST_MODEL": "deepseek-chat",
      "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-chat",
      "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-chat",
      "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "8192",
      "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
    },
    "claude-3-5-sonnet": {
      "ANTHROPIC_AUTH_TOKEN": "your-anthropic-token-here",
      "ANTHROPIC_BASE_URL": "https://api.anthropic.com",
      "ANTHROPIC_MODEL": "claude-3-5-sonnet-20241022",
      "ANTHROPIC_SMALL_FAST_MODEL": "claude-3-haiku-20240307",
      "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-3-5-sonnet-20241022",
      "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-3-opus-20240229",
      "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "8192",
      "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "0"
    }
  }
}

⚙️ Configuration

Environment Variables

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | ANTHROPIC_AUTH_TOKEN | ✅ | - | API authentication token | | ANTHROPIC_BASE_URL | ✅ | - | API base URL | | ANTHROPIC_MODEL | ✅ | - | Main model name | | ANTHROPIC_SMALL_FAST_MODEL | ❌ | Same as ANTHROPIC_MODEL | Small fast model | | ANTHROPIC_DEFAULT_SONNET_MODEL | ❌ | Same as ANTHROPIC_MODEL | Default Sonnet model | | ANTHROPIC_DEFAULT_OPUS_MODEL | ❌ | Same as ANTHROPIC_MODEL | Default Opus model | | CLAUDE_CODE_MAX_OUTPUT_TOKENS | ❌ | 8192 | Maximum output tokens | | CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | ❌ | 1 | Disable non-essential traffic |

Special Rules

  1. start command: ccms start <model> injects model config as environment variables and launches claude with --dangerously-skip-permissions (yolo mode)
  2. config command: ccms config <model> writes model config to ~/.claude/settings.json for persistent configuration
  3. shared env vars: variables in shared apply to every model; model-specific values override shared ones
  4. Default Values:
    • CLAUDE_CODE_MAX_OUTPUT_TOKENS defaults to 8192
    • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC defaults to 1
    • Unset model fields automatically use the value of ANTHROPIC_MODEL
  5. Configuration File: Empty configuration file {"shared": {}, "models": {}} is automatically created on first run
  6. Unset Command: ccms unset removes only model-specific variables from settings.json and restores official models

📁 File Locations

  • Model configuration file: ~/.claude-code-model-switch/settings.json
  • Claude Code settings file (used by config / unset): ~/.claude/settings.json

🔧 Development

# Clone repository
git clone https://github.com/musnows/claude-code-model-switch.git
cd claude-code-model-switch

# Install dependencies
npm install

# Global link (for development)
npm link

📄 License

MIT License

🤝 Contributing

Issues and Pull Requests are welcome!

🔗 Repository

https://github.com/musnows/claude-code-model-switch