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.

介绍

Claude Code Hooks are shell commands that run automatically before or after tool use. This collection offers 20+ ready-to-use hook recipes: auto-formatting, running tests, security scanning, Slack notifications, and more. Copy them into settings.json and go. Ideal for developers who want to enforce code quality and automate repetitive tasks.


Quick Use

Edit ~/.claude/settings.json and add hooks:

{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "command": "npx biome check --write $CLAUDE_FILE_PATH 2>/dev/null || true"
    }]
  }
}

Intro

Claude Code Hooks are shell commands that run automatically before or after tool use. This collection offers 20+ ready-to-use hook recipes: auto-formatting, running tests, security scanning, Slack notifications, and more. Copy them into settings.json and go. Ideal for developers who want to enforce code quality and automate repetitive tasks.


Source & Thanks

Community-maintained collection based on the official Claude Code docs. Contributions welcome — share your hook recipes!

🙏

来源与感谢

Community-maintained collection based on the official Claude Code docs. Contributions welcome — share your hook recipes!

讨论

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

相关资产