Skip to content

Commit 3d40642

Browse files
committed
docs: update PostToolUse hook format to new array syntax with matchers
1 parent 13434a8 commit 3d40642

2 files changed

Lines changed: 41 additions & 5 deletions

File tree

docs/src/kg/learnings-system.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,19 @@ Add to your Claude Code configuration to automatically capture failed Bash comma
9797
```json
9898
{
9999
"hooks": {
100-
"PostToolUse": ".claude/hooks/learning-capture.sh"
100+
"PostToolUse": [
101+
{
102+
"matcher": {
103+
"tools": ["BashTool"]
104+
},
105+
"hooks": [
106+
{
107+
"type": "command",
108+
"command": ".claude/hooks/learning-capture.sh"
109+
}
110+
]
111+
}
112+
]
101113
}
102114
}
103115
```

skills/learning-capture/skill.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,22 @@ terraphim-agent learn capture "git push -f" \
3636
Enable automatic capture of all failed Bash commands:
3737

3838
```bash
39-
# Add to .claude/config.json
39+
# Add to .claude/settings.json
4040
{
4141
"hooks": {
42-
"PostToolUse": ".claude/hooks/learning-capture.sh"
42+
"PostToolUse": [
43+
{
44+
"matcher": {
45+
"tools": ["BashTool"]
46+
},
47+
"hooks": [
48+
{
49+
"type": "command",
50+
"command": ".claude/hooks/learning-capture.sh"
51+
}
52+
]
53+
}
54+
]
4355
}
4456
}
4557
```
@@ -150,12 +162,24 @@ The following are automatically ignored (not captured):
150162

151163
### Hook Configuration
152164

153-
Create or edit `.claude/config.json`:
165+
Create or edit `.claude/settings.json`:
154166

155167
```json
156168
{
157169
"hooks": {
158-
"PostToolUse": ".claude/hooks/learning-capture.sh"
170+
"PostToolUse": [
171+
{
172+
"matcher": {
173+
"tools": ["BashTool"]
174+
},
175+
"hooks": [
176+
{
177+
"type": "command",
178+
"command": ".claude/hooks/learning-capture.sh"
179+
}
180+
]
181+
}
182+
]
159183
}
160184
}
161185
```

0 commit comments

Comments
 (0)