Skip to content

Commit fa35aef

Browse files
nhortonclaude
andcommitted
fix: add missing hook fields and event types to settings schema
Add `if`, `asyncRewake`, `once`, `shell` fields to hookCommand definitions and add missing hook events: StopFailure, PermissionDenied, TaskCreated, FileChanged, CwdChanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 589f6b8 commit fa35aef

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

src/deepwork/standard_schemas/claude_settings/claude_settings.schema.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,26 @@
6161
"statusMessage": {
6262
"type": "string",
6363
"description": "Custom spinner message displayed while the hook runs"
64+
},
65+
"if": {
66+
"$ref": "#/$defs/permissionRule",
67+
"description": "Only run this hook when the tool call matches this permission rule pattern. Only evaluated for tool events (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied); silently ignored on all other events. See https://code.claude.com/docs/en/hooks"
68+
},
69+
"asyncRewake": {
70+
"type": "boolean",
71+
"description": "Run this hook in the background and wake Claude when the process exits with code 2 (implies async: true)"
72+
},
73+
"once": {
74+
"type": "boolean",
75+
"description": "If true, runs once per session then removed"
76+
},
77+
"shell": {
78+
"type": "string",
79+
"enum": [
80+
"bash",
81+
"powershell"
82+
],
83+
"description": "Shell interpreter to use (default: bash)"
6484
}
6585
}
6686
},
@@ -95,6 +115,14 @@
95115
"statusMessage": {
96116
"type": "string",
97117
"description": "Custom spinner message displayed while the hook runs"
118+
},
119+
"if": {
120+
"$ref": "#/$defs/permissionRule",
121+
"description": "Only run this hook when the tool call matches this permission rule pattern. Only evaluated for tool events (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied); silently ignored on all other events. See https://code.claude.com/docs/en/hooks"
122+
},
123+
"once": {
124+
"type": "boolean",
125+
"description": "If true, runs once per session then removed"
98126
}
99127
}
100128
},
@@ -129,6 +157,14 @@
129157
"statusMessage": {
130158
"type": "string",
131159
"description": "Custom spinner message displayed while the hook runs"
160+
},
161+
"if": {
162+
"$ref": "#/$defs/permissionRule",
163+
"description": "Only run this hook when the tool call matches this permission rule pattern. Only evaluated for tool events (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied); silently ignored on all other events. See https://code.claude.com/docs/en/hooks"
164+
},
165+
"once": {
166+
"type": "boolean",
167+
"description": "If true, runs once per session then removed"
132168
}
133169
}
134170
},
@@ -174,6 +210,14 @@
174210
"statusMessage": {
175211
"type": "string",
176212
"description": "Custom spinner message displayed while the hook runs"
213+
},
214+
"if": {
215+
"$ref": "#/$defs/permissionRule",
216+
"description": "Only run this hook when the tool call matches this permission rule pattern. Only evaluated for tool events (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied); silently ignored on all other events. See https://code.claude.com/docs/en/hooks"
217+
},
218+
"once": {
219+
"type": "boolean",
220+
"description": "If true, runs once per session then removed"
177221
}
178222
}
179223
}
@@ -677,6 +721,13 @@
677721
"$ref": "#/$defs/hookMatcher"
678722
}
679723
},
724+
"PermissionDenied": {
725+
"type": "array",
726+
"description": "Hooks that run when auto mode denies a tool call. See https://code.claude.com/docs/en/hooks",
727+
"items": {
728+
"$ref": "#/$defs/hookMatcher"
729+
}
730+
},
680731
"Notification": {
681732
"type": "array",
682733
"description": "Hooks that trigger on notifications",
@@ -698,6 +749,13 @@
698749
"$ref": "#/$defs/hookMatcher"
699750
}
700751
},
752+
"StopFailure": {
753+
"type": "array",
754+
"description": "Hooks that run when a turn ends due to an API error. See https://code.claude.com/docs/en/hooks",
755+
"items": {
756+
"$ref": "#/$defs/hookMatcher"
757+
}
758+
},
701759
"SubagentStart": {
702760
"type": "array",
703761
"description": "Hooks that run when a subagent is spawned",
@@ -747,6 +805,13 @@
747805
"$ref": "#/$defs/hookMatcher"
748806
}
749807
},
808+
"TaskCreated": {
809+
"type": "array",
810+
"description": "Hooks that run when a task is created via TaskCreate. See https://code.claude.com/docs/en/hooks",
811+
"items": {
812+
"$ref": "#/$defs/hookMatcher"
813+
}
814+
},
750815
"TaskCompleted": {
751816
"type": "array",
752817
"description": "Hooks that run when a task is being marked as completed. Exit code 2 prevents completion and sends feedback. Does not support matchers. See https://code.claude.com/docs/en/hooks#taskcompleted",
@@ -775,6 +840,20 @@
775840
"$ref": "#/$defs/hookMatcher"
776841
}
777842
},
843+
"FileChanged": {
844+
"type": "array",
845+
"description": "Hooks that run when a watched file changes on disk. See https://code.claude.com/docs/en/hooks",
846+
"items": {
847+
"$ref": "#/$defs/hookMatcher"
848+
}
849+
},
850+
"CwdChanged": {
851+
"type": "array",
852+
"description": "Hooks that run when the working directory changes. See https://code.claude.com/docs/en/hooks",
853+
"items": {
854+
"$ref": "#/$defs/hookMatcher"
855+
}
856+
},
778857
"WorktreeCreate": {
779858
"type": "array",
780859
"description": "Hooks that run when a worktree is created via --worktree or isolation: \"worktree\" in subagents. Command handlers only, no matchers. Hook must print absolute path to created worktree on stdout; non-zero exit fails creation. See https://code.claude.com/docs/en/hooks#worktreecreate",

0 commit comments

Comments
 (0)