Skills2026年4月6日·1 分钟阅读

Claude Code Hooks — Custom Automation Recipes

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.

SK
Skill Factory · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 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 配方!

讨论

登录后参与讨论。
还没有评论,来写第一条吧。