{"id":147,"date":"2026-06-16T10:23:20","date_gmt":"2026-06-16T01:23:20","guid":{"rendered":"https:\/\/www.wetch.co.jp\/ai\/?p=147"},"modified":"2026-06-16T10:23:20","modified_gmt":"2026-06-16T01:23:20","slug":"claude-code-hooks%e5%85%a5%e9%96%80%ef%bc%9a%e7%b7%a8%e9%9b%86%e5%be%8c%e3%81%ae%e8%87%aa%e5%8b%95%e3%83%95%e3%82%a9%e3%83%bc%e3%83%9e%e3%83%83%e3%83%88%e3%83%bb%e5%8d%b1%e9%99%ba%e3%82%b3%e3%83%9e","status":"publish","type":"post","link":"https:\/\/www.wetch.co.jp\/ai\/2026\/06\/16\/claude-code-hooks%e5%85%a5%e9%96%80%ef%bc%9a%e7%b7%a8%e9%9b%86%e5%be%8c%e3%81%ae%e8%87%aa%e5%8b%95%e3%83%95%e3%82%a9%e3%83%bc%e3%83%9e%e3%83%83%e3%83%88%e3%83%bb%e5%8d%b1%e9%99%ba%e3%82%b3%e3%83%9e\/","title":{"rendered":"Claude Code Hooks\u5165\u9580\uff1a\u7de8\u96c6\u5f8c\u306e\u81ea\u52d5\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u30fb\u5371\u967a\u30b3\u30de\u30f3\u30c9\u306e\u30d6\u30ed\u30c3\u30af\u30fb\u30c6\u30b9\u30c8\u81ea\u52d5\u5b9f\u884c\u307e\u3067"},"content":{"rendered":"<p><em>Claude Code\u306b\u306f\u300chooks\uff08\u30d5\u30c3\u30af\uff09\u300d\u3068\u3044\u3046\u4ed5\u7d44\u307f\u304c\u3042\u308a\u307e\u3059\u3002\u30bb\u30c3\u30b7\u30e7\u30f3\u958b\u59cb\u30fb\u30c4\u30fc\u30eb\u5b9f\u884c\u524d\u5f8c\u30fb\u505c\u6b62\u306a\u3069\u3001Claude Code\u306e\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u4e0a\u306e\u7279\u5b9a\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30b7\u30a7\u30eb\u30b3\u30de\u30f3\u30c9\u3092\u81ea\u52d5\u5b9f\u884c\u3067\u304d\u308b\u3057\u304f\u307f\u3067\u3059\u3002MCP\u304cClaude\u306b\u65b0\u3057\u3044\u80fd\u529b\u3092\u4e0e\u3048\u308b\u306e\u306b\u5bfe\u3057\u3001hooks\u306f\u300cAI\u304c\u4f55\u3092\u3057\u3088\u3046\u3068\u3082\u5fc5\u305a\u5b9f\u884c\u3055\u308c\u308b\u4fdd\u8a3c\u300d\u3092\u4e0e\u3048\u307e\u3059\u3002\u672c\u8a18\u4e8b\u3067\u306fhooks\u306e\u6982\u5ff5\u304b\u3089\u3001\u3059\u3050\u4f7f\u3048\u308b\u30d1\u30bf\u30fc\u30f35\u9078\u307e\u3067\u3092\u5b9f\u969b\u306e\u8a2d\u5b9a\u4f8b\u3068\u3068\u3082\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.wetch.co.jp\/ai\/wp-content\/uploads\/2026\/06\/ill-agents.png\" alt=\"AI\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30fb\u30c4\u30fc\u30eb\u306e\u30a4\u30e9\u30b9\u30c8\"\/><\/figure>\n<h2>hooks\u3068\u306f\u4f55\u304b\uff1a\u300cAI\u306e\u5224\u65ad\u300d\u3067\u306f\u306a\u304f\u300c\u78ba\u5b9f\u306a\u5b9f\u884c\u300d<\/h2>\n<p>Claude Code\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u304b\u305b\u308b\u3068\u304d\u3001AI\u304c\u300cPrettier\u3092\u5b9f\u884c\u3057\u3088\u3046\u300d\u3068\u5224\u65ad\u3057\u306a\u3051\u308c\u3070\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3055\u308c\u307e\u305b\u3093\u3002\u3057\u304b\u3057hooks\u3092\u4f7f\u3048\u3070\u3001<strong>\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u305f\u3073\u306b\u5fc5\u305aPrettier\u304c\u8d70\u308b<\/strong>\u3068\u3044\u3046\u4fdd\u8a3c\u3092\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u62c5\u4fdd\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304a\u3088\u3073\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306e\u8aac\u660e\u306b\u3088\u308c\u3070\u3001hooks\u306e\u4f4d\u7f6e\u3065\u3051\u306f\u3053\u3046\u3067\u3059\uff1a<\/p>\n<ul>\n<li><strong>MCP<\/strong>\uff1aClaude\u306b\u65b0\u3057\u3044\u80fd\u529b\uff08GitHub\u9023\u643a\u30fbDB\u30a2\u30af\u30bb\u30b9\u7b49\uff09\u3092\u8ffd\u52a0\u3059\u308b<\/li>\n<li><strong>hooks<\/strong>\uff1aClaude\u304c\u4f55\u3092\u3059\u308b\u304b\u306b\u95a2\u308f\u3089\u305a\u3001\u7279\u5b9a\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u5fc5\u305a\u5b9f\u884c\u3055\u308c\u308b\u51e6\u7406\u3092\u4fdd\u8a3c\u3059\u308b<\/li>\n<\/ul>\n<p>\u3053\u306e\u300c\u6c7a\u5b9a\u8ad6\u7684\u306a\u5b9f\u884c\u4fdd\u8a3c\u300d\u3053\u305d\u304chooks\u306e\u4fa1\u5024\u3067\u3059\u3002AI\u304c\u300c\u3084\u308a\u5fd8\u308c\u305f\u300d\u3067\u306f\u6e08\u307e\u306a\u3044\u51e6\u7406\u2014\u2014lint\u30fb\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u30fb\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30c1\u30a7\u30c3\u30af\u30fb\u76e3\u67fb\u30ed\u30b0\u2014\u2014\u3092\u4ed5\u8fbc\u3080\u5834\u6240\u3068\u3057\u3066\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u4f7f\u7528\u3067\u304d\u308b\u4e3b\u306a\u30d5\u30c3\u30af\u30a4\u30d9\u30f3\u30c8<\/h2>\n<p>Claude Code\u3067\u306f2026\u5e746\u6708\u6642\u70b9\u306730\u8fd1\u304f\u306e\u30d5\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30ab\u30c6\u30b4\u30ea\u5225\u306b\u6574\u7406\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u30ab\u30c6\u30b4\u30ea<\/th>\n<th>\u30a4\u30d9\u30f3\u30c8\u540d<\/th>\n<th>\u767a\u706b\u30bf\u30a4\u30df\u30f3\u30b0<\/th>\n<th>\u30d6\u30ed\u30c3\u30af\u53ef\u5426<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u30bb\u30c3\u30b7\u30e7\u30f3<\/td>\n<td>SessionStart<\/td>\n<td>\u30bb\u30c3\u30b7\u30e7\u30f3\u958b\u59cb\u6642<\/td>\n<td>\u4e0d\u53ef<\/td>\n<\/tr>\n<tr>\n<td>\u30bb\u30c3\u30b7\u30e7\u30f3<\/td>\n<td>SessionEnd<\/td>\n<td>\u30bb\u30c3\u30b7\u30e7\u30f3\u7d42\u4e86\u6642<\/td>\n<td>\u4e0d\u53ef<\/td>\n<\/tr>\n<tr>\n<td>\u30d7\u30ed\u30f3\u30d7\u30c8<\/td>\n<td>UserPromptSubmit<\/td>\n<td>\u30e6\u30fc\u30b6\u30fc\u304c\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u9001\u4fe1\u3059\u308b\u305f\u3073<\/td>\n<td>\u53ef<\/td>\n<\/tr>\n<tr>\n<td>\u30d7\u30ed\u30f3\u30d7\u30c8<\/td>\n<td>Stop<\/td>\n<td>Claude\u304c\u5fdc\u7b54\u3092\u5b8c\u4e86\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u304d<\/td>\n<td>\u53ef<\/td>\n<\/tr>\n<tr>\n<td>\u30c4\u30fc\u30eb\u547c\u3073\u51fa\u3057<\/td>\n<td><strong>PreToolUse<\/strong><\/td>\n<td>\u30c4\u30fc\u30eb\u5b9f\u884c\u306e\u76f4\u524d<\/td>\n<td><strong>\u53ef<\/strong><\/td>\n<\/tr>\n<tr>\n<td>\u30c4\u30fc\u30eb\u547c\u3073\u51fa\u3057<\/td>\n<td><strong>PostToolUse<\/strong><\/td>\n<td>\u30c4\u30fc\u30eb\u5b9f\u884c\u306e\u76f4\u5f8c<\/td>\n<td>\u4e0d\u53ef\uff08\u89b3\u5bdf\u30fb\u6ce8\u5165\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u30c4\u30fc\u30eb\u547c\u3073\u51fa\u3057<\/td>\n<td>PostToolUseFailure<\/td>\n<td>\u30c4\u30fc\u30eb\u5b9f\u884c\u5931\u6557\u6642<\/td>\n<td>\u4e0d\u53ef<\/td>\n<\/tr>\n<tr>\n<td>\u901a\u77e5<\/td>\n<td>Notification<\/td>\n<td>Claude Code\u304c\u901a\u77e5\u3092\u9001\u308b\u3068\u304d<\/td>\n<td>\u4e0d\u53ef<\/td>\n<\/tr>\n<tr>\n<td>\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8<\/td>\n<td>PreCompact<\/td>\n<td>\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u5727\u7e2e\u306e\u76f4\u524d<\/td>\n<td>\u53ef<\/td>\n<\/tr>\n<tr>\n<td>\u30b5\u30d6\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8<\/td>\n<td>SubagentStop<\/td>\n<td>\u30b5\u30d6\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304c\u5b8c\u4e86\u3057\u305f\u3068\u304d<\/td>\n<td>\u53ef<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.wetch.co.jp\/ai\/wp-content\/uploads\/2026\/06\/photo-automation.jpg\" alt=\"\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u4f5c\u696d\u3059\u308b\u958b\u767a\u8005\"\/><figcaption><small>Photo: <a href=\"https:\/\/www.flickr.com\/photos\/25554263@N04\/4021387627\" target=\"_blank\" rel=\"noopener\">Peer.Gynt<\/a> \/ CC BY-SA\uff08Openverse\u7d4c\u7531\uff09<\/small><\/figcaption><\/figure>\n<h2>settings.json\u306e\u57fa\u672c\u69cb\u9020<\/h2>\n<p>hooks\u306e\u8a2d\u5b9a\u306f<code>settings.json<\/code>\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002\u8aad\u307f\u8fbc\u307f\u9806\u306f\u4ee5\u4e0b\u306e3\u6bb5\u968e\u3067\u3001\u5f8c\u308d\u304c\u4e0a\u66f8\u304d\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li><code>~\/.claude\/settings.json<\/code>\uff1a\u500b\u4eba\u8a2d\u5b9a\uff08\u5168\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5171\u901a\uff09<\/li>\n<li><code>.claude\/settings.json<\/code>\uff1a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u8a2d\u5b9a\uff08\u30c1\u30fc\u30e0\u5171\u6709\u30fb\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u542b\u3081\u308b\uff09<\/li>\n<li><code>.claude\/settings.local.json<\/code>\uff1a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u500b\u4eba\u8a2d\u5b9a\uff08gitignore\u63a8\u5968\uff09<\/li>\n<\/ol>\n<p>\u57fa\u672c\u69cb\u9020\u306f\u3053\u3046\u3067\u3059\uff1a<\/p>\n<pre><code>{\n  \"hooks\": {\n    \"\u30a4\u30d9\u30f3\u30c8\u540d\": [\n      {\n        \"matcher\": \"\u30c4\u30fc\u30eb\u540d\uff08\u6b63\u898f\u8868\u73fe\uff09\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"\u5b9f\u884c\u3059\u308b\u30b7\u30a7\u30eb\u30b3\u30de\u30f3\u30c9\"\n          }\n        ]\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p><code>matcher<\/code>\u306f<code>PreToolUse<\/code>\/<code>PostToolUse<\/code>\u3067\u306f\u30c4\u30fc\u30eb\u540d\u306b\u5bfe\u3059\u308b\u6b63\u898f\u8868\u73fe\u3067\u3059\u3002<code>\"Write|Edit\"<\/code>\u306e\u3088\u3046\u306b\u30d1\u30a4\u30d7\u3067\u8907\u6570\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<code>matcher<\/code>\u3092\u7a7a\u6587\u5b57\u5217\u306b\u3059\u308b\u3068\u5168\u30c4\u30fc\u30eb\u306b\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<h2>\u5b9f\u7528\u30d5\u30c3\u30af5\u9078\uff1a\u30b3\u30d4\u30fc\u3057\u3066\u4f7f\u3048\u308b\u30b5\u30f3\u30d7\u30eb<\/h2>\n<h3>1. PostToolUse\uff1a\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6\u5f8c\u306b\u81ea\u52d5\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h3>\n<p>Claude Code\u304c\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u30fb\u7de8\u96c6\u3059\u308b\u305f\u3073\u306bPrettier\u3068ESLint\u3092\u81ea\u52d5\u5b9f\u884c\u3057\u307e\u3059\u3002AI\u304c\u300c\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3057\u5fd8\u308c\u308b\u300d\u554f\u984c\u3092\u30bc\u30ed\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><code>{\n  \"hooks\": {\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Write|Edit\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"prettier --write \\\"$CLAUDE_TOOL_INPUT_FILE_PATH\\\" && eslint --fix \\\"$CLAUDE_TOOL_INPUT_FILE_PATH\\\" 2&gt;&amp;1 | head -5 || true\"\n          }\n        ]\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p>\u74b0\u5883\u5909\u6570 <code>$CLAUDE_TOOL_INPUT_FILE_PATH<\/code> \u306b\u306f\u7de8\u96c6\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u304c\u81ea\u52d5\u7684\u306b\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>2. PreToolUse\uff1a\u5371\u967a\u306a\u30b3\u30de\u30f3\u30c9\u3092\u30d6\u30ed\u30c3\u30af<\/h3>\n<p><code>PreToolUse<\/code>\u30d5\u30c3\u30af\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u304c <strong>exit code 2<\/strong> \u3092\u8fd4\u3059\u3068\u3001Claude\u306f\u305d\u306e\u30c4\u30fc\u30eb\u547c\u3073\u51fa\u3057\u3092\u5b9f\u884c\u305b\u305a\u3001stderr\u306e\u5185\u5bb9\u3092\u7406\u7531\u3068\u3057\u3066\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u4f7f\u3063\u3066 <code>rm -rf<\/code>\u3001<code>DROP TABLE<\/code>\u3001<code>git push --force<\/code> \u306a\u3069\u306e\u5371\u967a\u306a\u64cd\u4f5c\u3092\u9632\u5fa1\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"~\/.claude\/hooks\/safety-check.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p><code>safety-check.sh<\/code> \u306e\u4e2d\u3067\u306f <code>$CLAUDE_TOOL_INPUT<\/code> \u306bBash\u30b3\u30de\u30f3\u30c9\u6587\u5b57\u5217\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u5371\u967a\u306a\u30d1\u30bf\u30fc\u30f3\u3092grep\u3057\u3066exit 2\u3092\u8fd4\u3059\u5b9f\u88c5\u304c\u5178\u578b\u3067\u3059\u3002<\/p>\n<h3>3. SessionStart\uff1a\u4f5c\u696d\u958b\u59cb\u6642\u306bgit\u306e\u72b6\u6cc1\u3092\u78ba\u8a8d<\/h3>\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3\u958b\u59cb\u6642\u306bgit status\u3068\u30ed\u30b0\u3092\u81ea\u52d5\u8868\u793a\u3059\u308b\u3053\u3068\u3067\u3001Claude\u304c\u6bce\u56de\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u73fe\u72b6\u3092\u628a\u63e1\u3057\u305f\u72b6\u614b\u3067\u30b9\u30bf\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>{\n  \"hooks\": {\n    \"SessionStart\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"cd \\\"$CLAUDE_PROJECT_DIR\\\" &amp;&amp; git status --short &amp;&amp; git log --oneline -5\"\n          }\n        ]\n      }\n    ]\n  }\n}<\/code><\/pre>\n<h3>4. Stop\uff1a\u30bb\u30c3\u30b7\u30e7\u30f3\u7d42\u4e86\u524d\u306b\u30c6\u30b9\u30c8\u3092\u81ea\u52d5\u5b9f\u884c<\/h3>\n<p><code>Stop<\/code>\u30d5\u30c3\u30af\u306fClaude\u304c\u300c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u300d\u3068\u7d42\u4e86\u3057\u3088\u3046\u3068\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u767a\u706b\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3057\u3001<strong>\u5931\u6557\u3057\u305f\u3089 <code>\"decision\": \"block\"<\/code> \u3092\u8fd4\u3059<\/strong>\u3053\u3068\u3067\u3001\u30c6\u30b9\u30c8\u304c\u901a\u308b\u307e\u3067Claude\u306b\u4f5c\u696d\u3092\u7d99\u7d9a\u3055\u305b\u3089\u308c\u307e\u3059\u3002<\/p>\n<pre><code>{\n  \"hooks\": {\n    \"Stop\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"cd \\\"$CLAUDE_PROJECT_DIR\\\" &amp;&amp; npm test 2&gt;&amp;1 | tail -20\"\n          }\n        ]\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p>\u30c6\u30b9\u30c8\u304c\u5931\u6557\u3059\u308b\u3068Claude\u306f\u30a8\u30e9\u30fc\u5185\u5bb9\u3092\u53d7\u3051\u53d6\u3063\u3066\u4fee\u6b63\u3092\u8a66\u307f\u307e\u3059\u3002\u300c\u30c6\u30b9\u30c8\u304c\u8d64\u3044\u306e\u306b\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u9589\u3058\u308b\u300d\u554f\u984c\u3092\u81ea\u52d5\u7684\u306b\u9632\u3052\u307e\u3059\u3002<\/p>\n<h3>5. Notification\uff1a\u6a29\u9650\u30d7\u30ed\u30f3\u30d7\u30c8\u3092Discord\u306b\u901a\u77e5<\/h3>\n<p>Claude\u304c\u6a29\u9650\u3092\u6c42\u3081\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067Discord\u306eWebhook\u306b\u901a\u77e5\u3092\u9001\u308c\u307e\u3059\u3002Claude\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u52d5\u304b\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3001\u30b9\u30de\u30db\u3067\u78ba\u8a8d\u30fb\u627f\u8a8d\u306e\u5224\u65ad\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>{\n  \"hooks\": {\n    \"Notification\": [\n      {\n        \"matcher\": \"permission_prompt\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"node ~\/.claude\/hooks\/discord-notify.js\"\n          }\n        ]\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p>Discord Webhook URL\u306a\u3069\u79d8\u5bc6\u60c5\u5831\u3092\u542b\u3080\u5834\u5408\u306f\u3001\u30c1\u30fc\u30e0\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u306f\u5165\u308c\u305a <code>~\/.claude\/settings.json<\/code>\uff08\u500b\u4eba\u8a2d\u5b9a\uff09\u306b\u7f6e\u304f\u306e\u304c\u63a8\u5968\u3067\u3059\u3002<\/p>\n<h2>hooks vs MCP\uff1a\u4f55\u304c\u9055\u3046\u304b<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u6bd4\u8f03\u8ef8<\/th>\n<th>hooks<\/th>\n<th>MCP<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u5f79\u5272<\/td>\n<td>\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u306e\u7279\u5b9a\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u78ba\u5b9f\u306b\u5b9f\u884c<\/td>\n<td>Claude\u306b\u65b0\u3057\u3044\u30c4\u30fc\u30eb\u80fd\u529b\u3092\u8ffd\u52a0<\/td>\n<\/tr>\n<tr>\n<td>\u5b9f\u884c\u30c8\u30ea\u30ac\u30fc<\/td>\n<td>\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\uff08\u81ea\u52d5\uff09<\/td>\n<td>Claude \u304c\u5224\u65ad\u3057\u3066\u547c\u3073\u51fa\u3059<\/td>\n<\/tr>\n<tr>\n<td>\u30d6\u30ed\u30c3\u30af\u53ef\u5426<\/td>\n<td>PreToolUse \/ Stop \u306f\u5b9f\u884c\u3092\u6b62\u3081\u3089\u308c\u308b<\/td>\n<td>\u6b62\u3081\u3089\u308c\u306a\u3044<\/td>\n<\/tr>\n<tr>\n<td>\u5b9f\u88c5\u5f62\u614b<\/td>\n<td>\u30b7\u30a7\u30eb\u30b3\u30de\u30f3\u30c9\uff08\u307e\u305f\u306fHTTP\u30b3\u30fc\u30eb\uff09<\/td>\n<td>MCP\u30b5\u30fc\u30d0\u30fc\uff08\u30d7\u30ed\u30bb\u30b9 or SSE\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u9069\u7528\u4f8b<\/td>\n<td>lint\u30fb\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u30fb\u76e3\u67fb\u30ed\u30b0\u30fb\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ac\u30fc\u30c9<\/td>\n<td>GitHub\u30fbDB\u30fbSlack\u30fb\u30d6\u30e9\u30a6\u30b6\u64cd\u4f5c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e21\u8005\u306f\u88dc\u5b8c\u7684\u3067\u3059\u3002MCP\u30c4\u30fc\u30eb\u547c\u3073\u51fa\u3057\u306e\u76f4\u524d\u306b<code>PreToolUse<\/code>\u30d5\u30c3\u30af\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u3001MCP\u30c4\u30fc\u30eb\u306e\u5b9f\u884c\u7d50\u679c\u3092<code>PostToolUse<\/code>\u30d5\u30c3\u30af\u3067\u76e3\u67fb\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u3001\u3068\u3044\u3063\u305f\u7d44\u307f\u5408\u308f\u305b\u3082\u6709\u52b9\u3067\u3059\u3002<\/p>\n<h2>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u6ce8\u610f\u70b9<\/h2>\n<p>hooks\u306f\u5f37\u529b\u306a\u81ea\u52d5\u5316\u6a5f\u80fd\u3067\u3042\u308b\u53cd\u9762\u3001<strong>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u6539\u3056\u3093\u306b\u3088\u308b\u60aa\u7528\u30ea\u30b9\u30af<\/strong>\u3082\u3042\u308a\u307e\u3059\u30022026\u5e745\u6708\u306b\u306f\u3001npm \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u901a\u3058\u3066 <code>~\/.claude\/settings.json<\/code> \u306b\u60aa\u610f\u3042\u308b <code>SessionStart<\/code> \u30d5\u30c3\u30af\u304c\u6ce8\u5165\u3055\u308c\u308b\u653b\u6483\u4e8b\u4f8b\u304c\u5831\u544a\u3055\u308c\u3066\u3044\u307e\u3059\uff08<a href=\"https:\/\/www.stepsecurity.io\/blog\/multiple-redhat-cloud-services-npm-packages-compromised\" target=\"_blank\" rel=\"noopener\">StepSecurity \u30ec\u30dd\u30fc\u30c8<\/a>\uff09\u3002<\/p>\n<p>\u5b89\u5168\u306b\u4f7f\u3046\u305f\u3081\u306e\u30dd\u30a4\u30f3\u30c8\uff1a<\/p>\n<ul>\n<li><strong>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5b9a\u671f\u7684\u306b\u78ba\u8a8d\u3059\u308b<\/strong>\uff1a<code>~\/.claude\/settings.json<\/code> \u3068 <code>.claude\/settings.json<\/code> \u3092\u76ee\u8996\u3067\u30ec\u30d3\u30e5\u30fc\u3059\u308b\u7fd2\u6163\u3092\u6301\u3064<\/li>\n<li><strong>hook\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3059\u308b<\/strong>\uff1a<code>.claude\/hooks\/<\/code> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092git\u3067\u7ba1\u7406\u3057\u3001\u5909\u66f4\u5c65\u6b74\u3092\u8ffd\u8de1\u3059\u308b<\/li>\n<li><strong>hook\u306f\u8584\u304f\u4fdd\u3064<\/strong>\uff1a1\u3064\u306ehook\u30d5\u30a1\u30a4\u30eb\u306b\u8907\u6570\u306e\u5f79\u5272\u3092\u6301\u305f\u305b\u305a\u3001\u30ed\u30b8\u30c3\u30af\u306f\u5171\u901a\u30e9\u30a4\u30d6\u30e9\u30ea\/\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u5207\u308a\u51fa\u3059<\/li>\n<li><strong>Webhook\u306a\u3069\u306e\u79d8\u5bc6\u60c5\u5831\u306f\u500b\u4eba\u8a2d\u5b9a\u306b<\/strong>\uff1a<code>~\/.claude\/settings.json<\/code> \u306b\u7f6e\u304d\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u306f\u30b3\u30df\u30c3\u30c8\u3057\u306a\u3044<\/li>\n<\/ul>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Claude Code hooks\u306f\u3001AI\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u300c\u78ba\u5b9f\u6027\u300d\u3092\u9ad8\u3081\u308b\u6a5f\u80fd\u3067\u3059\u3002MCP\u304c\u300c\u4f55\u304c\u3067\u304d\u308b\u304b\u300d\u3092\u62e1\u5f35\u3059\u308b\u306e\u306b\u5bfe\u3057\u3001hooks\u306f\u300c\u4f55\u304c\u5fc5\u305a\u8d77\u304d\u308b\u304b\u300d\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002\u307e\u305a<code>PostToolUse<\/code>\u3067\u81ea\u52d5\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304b\u3089\u59cb\u3081\u3066\u3001\u5f90\u3005\u306b<code>PreToolUse<\/code>\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ac\u30fc\u30c9\u3001<code>Stop<\/code>\u306e\u30c6\u30b9\u30c8\u30b2\u30fc\u30c8\u3078\u3068\u80b2\u3066\u3066\u3044\u304f\u306e\u304c\u3001\u5b9f\u969b\u306b\u4f7f\u3044\u7d9a\u3051\u3066\u3044\u308b\u30a8\u30f3\u30b8\u30cb\u30a2\u305f\u3061\u306e\u63a8\u5968\u30eb\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<hr \/>\n<h2>\u4e3b\u306a\u60c5\u5831\u6e90<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.vibecodingacademy.ai\/blog\/claude-code-hooks-complete-guide\" target=\"_blank\" rel=\"noopener\">Claude Code Hooks: Complete Guide to Automating Dev Workflows \u2014 Vibe Coding Academy<\/a><\/li>\n<li><a href=\"https:\/\/www.morphllm.com\/claude-code-hooks\" target=\"_blank\" rel=\"noopener\">Claude Code &amp; Agent SDK Hooks (2026): PreToolUse, PostToolUse \u2014 MorphLLM<\/a><\/li>\n<li><a href=\"https:\/\/israynotarray.com\/en\/ai\/2026\/05\/31\/claude-code-hooks-complete-guide\" target=\"_blank\" rel=\"noopener\">What Are Claude Code Hooks? \u2014 Is Ray, Not Array<\/a><\/li>\n<li><a href=\"https:\/\/computingforgeeks.com\/claude-code-hooks-guide\" target=\"_blank\" rel=\"noopener\">Claude Code Hooks: The Complete Guide \u2014 ComputingForGeeks<\/a><\/li>\n<li><a href=\"https:\/\/www.eesel.ai\/blog\/claude-code-cli-reference\" target=\"_blank\" rel=\"noopener\">A developer&#8217;s Claude Code CLI reference (2026 guide) \u2014 eesel AI<\/a><\/li>\n<li><a href=\"https:\/\/www.marktechpost.com\/2026\/06\/14\/claude-code-guide-2026-25-features-with-examples-demo\" target=\"_blank\" rel=\"noopener\">Claude Code Guide 2026: 25 Features with Examples + Demo \u2014 MarkTechPost<\/a><\/li>\n<li><a href=\"https:\/\/generalanalysis.com\/guides\/anthropic-claude-code-security-best-practices\" target=\"_blank\" rel=\"noopener\">Anthropic Claude Code Security Best Practices \u2014 General Analysis<\/a><\/li>\n<\/ul>\n<p><small>\u5404\u30c4\u30fc\u30eb\u306f\u63d0\u4f9b\u5143\u306e\u898f\u7d04\u306b\u5f93\u3063\u3066\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002\u60c5\u5831\u306f\u5404\u60c5\u5831\u6e90\u306e\u516c\u958b\u6642\u70b9\u306e\u3082\u306e\u3067\u3059\u3002\u53ce\u96c6\u30fb\u8981\u7d04\u306fAI\u3001\u516c\u958b\u5224\u65ad\u306f\u4eba\u3002<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Claude Code\u306ehooks\u6a5f\u80fd\u3092\u4f7f\u3048\u3070\u3001\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6\u5f8c\u306e\u81ea\u52d5lint\u30fb\u5371\u967a\u306a\u30b3\u30de\u30f3\u30c9\u306e\u30d6\u30ed\u30c3\u30af\u30fb\u30bb\u30c3\u30b7\u30e7\u30f3\u7d42\u4e86\u6642\u306e\u30c6\u30b9\u30c8\u5b9f\u884c\u306a\u3069\u3001AI\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u3092\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u78ba\u5b9f\u306b\u81ea\u52d5\u5316\u3067\u304d\u307e\u3059\u3002settings.json\u3078\u306e\u66f8\u304d\u65b9\u304b\u3089\u5b9f\u7528\u30d1\u30bf\u30fc\u30f35\u9078\u307e\u3067\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":41,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"page_builder":"","footnotes":""},"categories":[11],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-claude-mcp"],"_links":{"self":[{"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":1,"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/posts\/147\/revisions\/149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/media\/41"}],"wp:attachment":[{"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/ai\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}