File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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```
Original file line number Diff line number Diff line change @@ -36,10 +36,22 @@ terraphim-agent learn capture "git push -f" \
3636Enable 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```
You can’t perform that action at this time.
0 commit comments