Token导航 LogoToken导航TokenDH.com
Cc Tools logo
开发工具未说明官方级别未说明来源级核验

Cc Tools

MCP Server

cc-tools是一个用于Claude Code的CLI工具,提供自动化钩子事件处理、并行代码验证、会话跟踪和通知管理功能,适用于开发者工作流优化。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
命令行工具GoClaude工作流优化Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

riddopic

提供方

riddopic

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

cc工具

CLI伴侣 克劳德代码 它自动化了钩子事件处理、并行lint/test验证、MCP服务器管理、通知、会话跟踪和每个目录跳过配置。

它做什么

cc工具插入Claude Code的钩子系统,在每个钩子事件上运行处理程序——会话生命周期、工具使用、通知和上下文压缩。当配置为 PostToolUse 钩子 validate 命令拦截文件编辑,并在接受更改之前并行运行项目的linter和测试套件。如果任一操作失败,工具调用将被阻止,并显示格式化的错误消息。

除了验证之外,cc工具还提供:

  • 吊钩调度 --一个处理程序注册表,将所有Claude Code钩子事件路由到专门构建的处理程序
  • 通知 --音频播放、macOS桌面警报和安静时间的ntfy推送通知
  • 会话跟踪 --存储会话元数据,支持别名和搜索
  • 观测记录 --记录工具使用事件进行分析
  • MCP管理 --启用/禁用MCP服务器集成
  • 跳过注册表 --lint、test或两者的每个目录跳过规则

安装

需要Go 1.26+和 任务.

task build      # Build to ./bin/cc-tools
task install    # Copy to $GOPATH/bin

命令

cc-tools  [arguments]
命令描述
hook将Claude Code钩子事件分派给已注册的处理程序(从stdin读取JSON)
validate并行运行lint和测试(从stdin读取JSON)
session列出、搜索和管理会话元数据和别名
config获取、设置、列出和重置应用程序设置
skip配置目录以跳过验证(lint、test或all)
unskip从目录中删除跳过设置
mcp管理Claude MCP服务器(列出、启用、禁用)
debug配置调试日志记录(启用、禁用、状态、列表、文件名)

钩子集成

添加到您的克劳德代码设置(~/.claude/settings.json):

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "*",
        "hooks": [{ "type": "command", "command": "cc-tools hook" }]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Write|Edit|MultiEdit",
        "hooks": [{ "type": "command", "command": "cc-tools validate" }]
      },
      {
        "matcher": "*",
        "hooks": [{ "type": "command", "command": "cc-tools hook" }]
      }
    ],
    "SessionStart": [
      {
        "matcher": "*",
        "hooks": [{ "type": "command", "command": "cc-tools hook" }]
      }
    ],
    "SessionEnd": [
      {
        "matcher": "*",
        "hooks": [{ "type": "command", "command": "cc-tools hook" }]
      }
    ],
    "UserPromptSubmit": [
      {
        "matcher": "*",
        "hooks": [{ "type": "command", "command": "cc-tools hook" }]
      }
    ],
    "Stop": [
      {
        "matcher": "*",
        "hooks": [{ "type": "command", "command": "cc-tools hook" }]
      }
    ],
    "Notification": [
      {
        "matcher": "*",
        "hooks": [{ "type": "command", "command": "cc-tools hook" }]
      }
    ],
    "PreCompact": [
      {
        "matcher": "*",
        "hooks": [{ "type": "command", "command": "cc-tools hook" }]
      }
    ]
  }
}

hook 命令从stdin读取事件JSON,分派给已注册的处理程序,并返回结构化输出。这 validate command发现项目的lint/test命令并同时运行它们。

注册处理程序

事件处理程序
SessionStart超级电源注入、包管理器检测、会话上下文
SessionEnd会话元数据持久化
PreToolUse精简建议、观察记录、提交前提醒
PostToolUse观察记录
UserPromptSubmit漂移检测(当会话偏离原始意图时发出警告)
停止使用循环会话提醒跟踪响应计数
预压缩原木压缩
通知音频播放、桌面提醒、ntfy推送

例子

# Dispatch a hook event (stdin receives event JSON)
echo '{"hook_event_name":"Notification","title":"Done","message":"Tests passed"}' | cc-tools hook

# Validate a file edit
echo '{"tool_name":"Edit","tool_input":{"file_path":"main.go"}}' | cc-tools validate

# Manage sessions
cc-tools session list
cc-tools session info 
cc-tools session search "auth refactor"
cc-tools session alias set latest 

# Manage MCP servers
cc-tools mcp list
cc-tools mcp enable jira
cc-tools mcp disable jira

# Skip validation for a directory
cc-tools skip lint /path/to/generated
cc-tools skip list

# Configure settings
cc-tools config set validate.timeout 120
cc-tools config get validate.timeout
cc-tools config list

配置

设置存储在 ~/.config/cc-tools/config.json.

密钥默认值描述
validate.timeout60验证超时(秒)
validate.cooldown5验证运行之间的冷却
notifications.ntfy_topic""ntfy.sh推送通知主题
compact.threshold50紧凑型建议的令牌阈值
compact.reminder_interval25紧凑型提醒之间的工具调用
notify.quiet_hours.enabledtrue在安静时段抑制通知
notify.quiet_hours.start"21:00"安静时间开始时间(HH:MM)
notify.quiet_hours.end"07:30"安静时间结束时间(HH:MM)
notify.audio.enabledtrue启用音频通知声音
notify.audio.directory"~/.claude/audio"MP3文件目录的路径
notify.desktop.enabledtrue启用macOS桌面通知
observe.enabledtrue启用工具使用观察日志记录
observe.max_file_size_mb10观测日志记录的最大文件大小(MB)
learning.min_session_length10学习提取的最小会话长度
learning.learned_skills_path".claude/skills/learned"学习技能文件的路径
pre_commit_reminder.enabledtrue提醒在git提交之前运行检查
pre_commit_reminder.command"task pre-commit"提交前建议的命令
package_manager.preferred""首选包管理器(覆盖自动检测)
drift.enabledtrue根据提示启用漂移检测
drift.min_edits6检查漂移前的最小编辑量
drift.threshold0.2关键字重叠率,低于该比率则标记漂移
stop_reminder.enabledtrue启用定期会话提醒
stop_reminder.interval20提醒之间的响应
stop_reminder.warn_at50强烈总结警告的响应计数

调试日志将写入 ~/.cache/cc-tools/debug/.

发展

task doctor         # Check required tools
task tools-install  # Install gotestsum, golangci-lint, goimports, mockery
task build          # Build binary
task test           # Fast tests (-short, 30s)
task lint           # golangci-lint
task check          # fmt + lint + test-race (run before committing)
task test-race      # Tests with race detector
task mocks          # Regenerate mocks
task coverage       # HTML coverage report

许可证

许可证 了解详情。

目录标签

目录标签

命令行工具GoClaude工作流优化CLI工具本地部署代码验证自动化开发者工具

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明session部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP