From 83542f2781ff718034160affad8b9134402a529e Mon Sep 17 00:00:00 2001 From: ytche Date: Wed, 15 Apr 2026 09:03:06 +0800 Subject: [PATCH 1/2] 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" + } + ] + } + ] + }, } ``` From f27b57dfc2e865014461382fc3dfcff5331b4c45 Mon Sep 17 00:00:00 2001 From: Luong NGUYEN Date: Wed, 22 Jul 2026 22:14:32 +0700 Subject: [PATCH 2/2] fix(zh/hooks): remove trailing comma in JSON config example The JSON example in the installation section had a trailing comma after the hooks object, making it invalid JSON. This prevents users from copy-pasting the configuration successfully. --- zh/06-hooks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh/06-hooks/README.md b/zh/06-hooks/README.md index 95359db..d306d47 100644 --- a/zh/06-hooks/README.md +++ b/zh/06-hooks/README.md @@ -64,7 +64,7 @@ chmod +x ~/.claude/hooks/*.sh ] } ] - }, + } } ```