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

ccsm

v1.0.3

Published

CLI tool for managing Claude Code settings.json configurations

Readme

CCSM (Claude Code Settings Manager)

一个用于管理 Claude Code 配置文件的命令行工具,让您可以轻松地在不同配置之间切换。

✨ 功能特性

  • 🔄 配置切换:快速在不同的 Claude Code 配置之间切换
  • 📝 配置创建:基于模板创建新的配置文件
  • 🗑️ 配置删除:安全删除不需要的配置(带确认提示)
  • 💾 配置备份:自动备份当前配置,防止数据丢失
  • 📋 配置列表:查看所有可用配置和当前使用的配置
  • 🎯 当前状态:快速查看当前正在使用的配置
  • 🔒 安全管理:配置文件权限保护,避免敏感信息泄露

📦 安装

NPM 安装

npm install -g ccsm

🚀 快速开始

1. 创建配置

# 使用默认模板创建配置
ccsm create dev

# 使用自定义模板创建配置
ccsm create production --template /path/to/template.json

2. 切换配置

# 切换到指定配置
ccsm switch dev

3. 查看配置

# 列出所有配置
ccsm list

# 查看当前配置
ccsm current

4. 备份配置

# 备份当前 Claude Code 配置
ccsm backup

5. 删除配置

# 删除配置(会有确认提示)
ccsm delete old-config

# 强制删除(跳过确认)
ccsm delete old-config --yes

📋 命令详解

ccsm create <name> [options]

创建新的配置文件。

参数:

  • name - 配置名称(必需)

选项:

  • -t, --template <path> - 指定模板文件路径

示例:

ccsm create development
ccsm create prod --template ./templates/production.json

ccsm switch <name>

切换到指定的配置文件。

参数:

  • name - 要切换的配置名称(必需)

示例:

ccsm switch development

ccsm list [options]

列出所有可用的配置文件。

别名: ls

选项:

  • --backups - 同时显示备份文件

示例:

ccsm list
ccsm ls --backups

ccsm current

显示当前正在使用的配置。

示例:

ccsm current

ccsm backup

备份当前 Claude Code 配置。

示例:

ccsm backup

ccsm delete <name> [options]

删除指定的配置文件。

参数:

  • name - 要删除的配置名称(必需)

选项:

  • -y, --yes - 跳过确认提示,直接删除

示例:

ccsm delete old-config
ccsm delete temp-config --yes

📁 配置存储

配置文件存储在以下位置:

  • Windows: %USERPROFILE%/.ccsm/
  • macOS: ~/.ccsm/
  • Linux: ~/.ccsm/

🔧 配置格式

配置文件使用 JSON 格式,遵循 Claude Code 的 settings.json 结构:

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "DISABLE_TELEMETRY": "1",
    "DISABLE_ERROR_REPORTING": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "ANTHROPIC_BASE_URL": "",
    "ANTHROPIC_AUTH_TOKEN": ""
  },
  "includeCoAuthoredBy": false,
  "permissions": {
    "allow": [],
    "deny": []
  },
  "hooks": {}
}

基于此,你可以添加自定义配置(比如 custom.json),比如加入允许的权限和MCP列表:

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "DISABLE_TELEMETRY": "1",
    "DISABLE_ERROR_REPORTING": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "ANTHROPIC_BASE_URL": "",
    "ANTHROPIC_AUTH_TOKEN": ""
  },
  "includeCoAuthoredBy": false,
  "permissions": {
    "allow": [
      "Bash",
      "LS",
      "Read",
      "Agent",
      "mcp__context7",
      "mcp__playwright"
    ],
    "deny": []
  },
  "hooks": {}
}

然后通过 ccsm create --template ~/custom.json moonshot_kimi_k2 根据自定义模板创建 Claude Code 配置文件。

🛡️ 安全特性

  • 文件权限保护: 配置文件设置为仅当前用户可读写(权限 600)
  • 输入验证: 严格验证配置名称,防止路径遍历等安全问题
  • 确认删除: 删除操作需要用户确认,防止误删
  • 备份机制: 自动生成带时间戳的备份文件

🚨 故障排除

配置文件权限问题

如果遇到权限错误,请检查:

  1. 配置目录是否存在且可访问
  2. 当前用户是否有读写权限

Claude Code 路径问题

用户设置都统一存放在 ~/.claude/settings.json

如果路径不正确,请检查 Claude Code 是否正确安装。

配置名称规则

配置名称不能包含:

  • 特殊字符: < > : " / \\ | ? *
  • 控制字符(ASCII 0-31)
  • 系统保留名称: CON, PRN, AUX, NUL, COM1-9, LPT1-9
  • 不能以 settings_backup_ 开头

🤝 贡献

欢迎贡献代码!请提交 Pull Request 或创建 Issue。

📄 许可证

MIT License

🔗 相关链接


提示: 使用 ccsm --helpccsm <command> --help 查看详细的帮助信息。