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

v1.0.0

Published

A TypeScript Node.js tool for managing Claude Code settings.json configuration switching

Readme

Claude Code Config Switch

A simple CLI tool to manage multiple Claude Code configuration profiles, allowing you to quickly switch between different API endpoints and authentication configurations.

npm version License: MIT

Why Use This Tool?

Claude Code uses ~/.claude/settings.json to configure API endpoints and authentication information. If you need to switch between different environments (development, production, or different API keys), manually editing the configuration file can be tedious.

This tool allows you to:

  • 🔄 Create and save multiple configuration profiles
  • ⚡ Switch between configurations with a single command
  • 🧹 Easily reset all configurations
  • 💾 Automatically backup and manage configuration files

Installation

Global Installation

# Using npm
npm install -g claude-code-config-switch

# Using pnpm
pnpm install -g claude-code-config-switch

# Using yarn
yarn global add claude-code-config-switch

Run Without Installing

# Using npx
npx claude-code-config-switch --help

# Using pnpm
pnpx claude-code-config-switch --help

# Using yarn
yarn dlx claude-code-config-switch --help

Usage

Create Configuration

# Interactive configuration creation
ccs create

# Create configuration with a specific name
ccs create production

The system will prompt you to enter:

  • Configuration name (if not specified)
  • ANTHROPIC_BASE_URL (API endpoint)
  • ANTHROPIC_AUTH_TOKEN (authentication token)
  • ANTHROPIC_API_KEY (optional, API key)
  • ANTHROPIC_MODEL (optional, default model)
  • ANTHROPIC_SMALL_FAST_MODEL (optional, fast model)

Switch Configuration

# List all available configurations and select one to switch
ccs env

# Directly switch to a specific configuration
ccs env production

Reset Configuration

# Clear all Claude Code environment variable configurations
ccs reset

⚠️ Note: The reset operation only removes Claude Code-related environment variables and does not affect other configurations in settings.json.

View Help

ccs --help

How It Works

Storage Location

  • Configuration files: Stored in ~/.claude-config/ directory
  • Naming format: claude-config.{config-name}.json
  • Active configuration: Applied to ~/.claude/settings.json

Configuration Switching

When you switch configurations, the tool will:

  1. Read the specified configuration file
  2. Clean up existing Claude Code environment variables in settings.json
  3. Merge the new configuration into settings.json
  4. Preserve other non-Claude Code related configurations

Managed Environment Variables

The tool manages the following environment variables:

  • ANTHROPIC_BASE_URL
  • ANTHROPIC_AUTH_TOKEN
  • ANTHROPIC_API_KEY
  • ANTHROPIC_MODEL
  • ANTHROPIC_SMALL_FAST_MODEL

Examples

Creating Development and Production Environment Configurations

# Create development environment configuration
ccs create development
# Enter development environment API information...

# Create production environment configuration
ccs create production
# Enter production environment API information...

# Switch between the two environments
ccs env development
ccs env production

View Current Configuration

# List all configurations
ccs env

Example output:

Available configurations:
  1. development (https://dev-api.anthropic.com)
  2. production (https://api.anthropic.com)

Configuration File Format

Configuration files are in standard JSON format:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.anthropic.com",
    "ANTHROPIC_AUTH_TOKEN": "your-auth-token",
    "ANTHROPIC_API_KEY": "your-api-key"
  }
}

Compatibility

  • Operating Systems: Supports Windows, macOS, Linux
  • Node.js: Requires Node.js 16 or higher
  • Claude Code: Compatible with all Claude Code versions using ~/.claude/settings.json

Development

# Clone the project
git clone https://github.com/your-username/claude-code-config-switch.git
cd claude-code-config-switch

# Install dependencies
pnpm install

# Run in development mode
pnpm dev

# Build
pnpm build

# Run tests
pnpm test

# Generate test coverage report
pnpm test:coverage

License

MIT License - see LICENSE file for details

Contributing

Issues and pull requests are welcome!

Support

If you find this tool useful, please give it a ⭐️!


Note: This tool is a third-party utility created to simplify Claude Code configuration management and is not affiliated with Anthropic.