简介
Claude Code Hooks 是在工具使用前后自动运行的 Shell 命令。本合集提供 20+ 即用 Hook 配方:自动格式化、运行测试、安全扫描、Slack 通知等。复制到 settings.json 即可使用。适合想要强制代码质量和自动化重复任务的开发者。
Collection of ready-to-use Claude Code hook recipes for automating code formatting, testing, notifications, and security checks. Copy-paste into settings.json. Community-maintained.
这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。
编辑 ~/.claude/settings.json,添加 hooks:
{
"hooks": {
"PostToolUse": [{
"matcher": "Write|Edit",
"command": "npx biome check --write $CLAUDE_FILE_PATH 2>/dev/null || true"
}]
}
}Claude Code Hooks 是在工具使用前后自动运行的 Shell 命令。本合集提供 20+ 即用 Hook 配方:自动格式化、运行测试、安全扫描、Slack 通知等。复制到 settings.json 即可使用。适合想要强制代码质量和自动化重复任务的开发者。
基于 Claude Code 官方文档的社区维护合集。欢迎贡献你的 Hook 配方!