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

@vinoorg/claude-model-switcher

v2.0.0

Published

Switch AI providers in Claude Code CLI via @provider syntax

Readme

Claude Model Switcher

If this tool helps you, consider giving it a ⭐ on GitHub — it means a lot!

中文文档

A lightweight CLI that lets you switch AI model providers in Claude Code with a simple @provider syntax.

Each terminal session runs independently — open multiple terminals and use different providers or models simultaneously, with zero conflict.

Quick Start

ccs @zhipu              # Use Zhipu GLM
ccs @zhipu:glm-4.6      # Specify model
ccs                      # Default provider

Installation

npm install -g @vinoorg/claude-model-switcher

Requirements: Bun >= 1.0, Claude Code CLI installed

Configuration

1. Create provider config

mkdir -p ~/.config/claude-model-switcher
cat > ~/.config/claude-model-switcher/providers.json << 'EOF'
[
  {
    "name": "zhipu",
    "base_url": "https://open.bigmodel.cn/api/anthropic",
    "api_key_env": "ZHIPU_API_KEY",
    "default_model": "glm-4.6",
    "default_small_model": "glm-4.5-air"
  },
  {
    "name": "lp",
    "base_url": "http://your-company.com/api/anthropic",
    "api_key_env": "LP_API_KEY"
  }
]
EOF

2. Set API keys

# ~/.zshrc or ~/.bashrc
export ZHIPU_API_KEY="your-key-here"
export LP_API_KEY="your-key-here"

3. Apply changes

source ~/.zshrc  # or source ~/.bashrc

Note: ccs transparently passes all arguments to the native claude CLI. Your existing Claude Code commands and flags work exactly as before — ccs only sets model-related environment variables.

Usage

ccs                          # Default provider
ccs @zhipu                   # Specific provider, default model
ccs @zhipu:glm-4.6           # Provider + model
ccs @list                    # List all providers & models
ccs @init                    # Init or validate config
ccs @update                  # Update to latest version
ccs @config                  # Open config file in editor
ccs @trace                   # Open traces directory in editor
ccs @trace latest            # Open the most recent trace session
ccs @trace <session-id>      # Open a specific trace session
ccs @trace clean             # Keep the latest 50 sessions, remove older ones
ccs @trace clean --all       # Remove all trace sessions
ccs @trace clean --keep N    # Keep the latest N sessions
ccs @help                    # Show help

# Works with all native Claude Code flags
ccs @zhipu -r sessionID
ccs @lp -p "Describe this project"

Status Bar Companion

Display the current provider, model, and context usage in your Claude Code status bar with ccs-statusline:

[v2.1.119]  ➜ my-project (main) @zhipu:glm-4.6  Ctx:45.2k/200k (22.6%)

Troubleshooting

Still connecting to an old API endpoint after using ccs

If you previously used tools like cc-switch that set ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, or ANTHROPIC_AUTH_TOKEN in your ~/.zshrc / ~/.bashrc, remove or comment out these variables. Otherwise they will be inherited by the child process and override ccs configuration.

Config Reference

| Field | Required | Description | | ------------------- | -------- | ---------------------------------------------------------------------------------------------- | | name | Yes | Provider identifier for @name. Only [a-zA-Z0-9_-]. Reserved: list, help, init, update, config | | base_url | Yes | Anthropic-compatible API endpoint | | api_key_env | Yes | Environment variable name holding the API key | | default_model | No | Model used when not specified | | default_small_model | No | Lightweight model (falls back to default_model) | | models | No | Available model list (string[]). Defaults to showing default_model + default_small_model | | trace | No | Set to true to record this provider's API traffic to ~/.config/claude-model-switcher/traces/ for debugging |

Rules:

  • Without @provider, the first entry is used as default
  • If default_model is not set, model must be specified explicitly (ccs @lp:some-model)
  • default_small_model only affects ANTHROPIC_SMALL_FAST_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL

Adding a new provider — just append to the config array and export the API key:

{
  "name": "kimi",
  "base_url": "https://api.kimi.com/anthropic",
  "api_key_env": "KIMI_API_KEY",
  "default_model": "kimi-latest"
}

No code changes needed.

Tracing API Traffic

Set "trace": true on a provider to record every Claude Code API request/response to that provider for debugging. Traces are written to ~/.config/claude-model-switcher/traces/ as JSONL files named <yyyymmddHHMMSS>-<provider>-<8hex>.jsonl (e.g. 20260701143022-zhipu-a1b2c3d4.jsonl). Sensitive request/response headers are redacted.

{
  "name": "zhipu",
  "base_url": "https://open.bigmodel.cn/api/anthropic",
  "api_key_env": "ZHIPU_API_KEY",
  "default_model": "glm-4.6",
  "trace": true
}

Inspect recorded sessions with ccs @trace (see Usage). By default the 50 most recent sessions are kept; older ones are pruned automatically when a new session is recorded. Use ccs @trace clean [--all|--keep N] to prune manually.

Note: a trace record's incomplete flag does not capture every upstream interruption. Bun.fetch (WHATWG Streams) may surface a mid-stream upstream break as a clean EOF, in which case incomplete stays false; the flag only fires when the proxy's stream read is rejected (e.g. TCP reset).

License

MIT