From 83542f2781ff718034160affad8b9134402a529e Mon Sep 17 00:00:00 2001 From: ytche Date: Wed, 15 Apr 2026 09:03:06 +0800 Subject: [PATCH] Fixed a configuration error in the hooks Chinese guide --- zh/06-hooks/README.md | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/zh/06-hooks/README.md b/zh/06-hooks/README.md index 3a84f8a..95359db 100644 --- a/zh/06-hooks/README.md +++ b/zh/06-hooks/README.md @@ -42,15 +42,29 @@ chmod +x ~/.claude/hooks/*.sh ```json { "hooks": { - "PreToolUse": [{ - "matcher": "Write", - "hooks": ["~/.claude/hooks/format-code.sh"] - }], - "PostToolUse": [{ - "matcher": "Write", - "hooks": ["~/.claude/hooks/security-scan.sh"] - }] - } + "PreToolUse": [ + { + "matcher": "Write", + "hooks": [ + { + "type": "command", + "command": "~/.claude/hooks/format-code.sh" + } + ] + } + ], + "PostToolUse": [ + { + "matcher": "Write", + "hooks": [ + { + "type": "command", + "command": "~/.claude/hooks/security-scan.sh" + } + ] + } + ] + }, } ```