claudecode-linter 2.1.148-patch.1 → 2.1.148-patch.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claudecode-lint.defaults.yaml +13 -0
- package/README.md +3 -3
- package/contracts/agent-frontmatter.schema.json +141 -1
- package/contracts/command-frontmatter.schema.json +127 -1
- package/contracts/hooks.schema.json +275 -0
- package/contracts/mcp.schema.json +302 -0
- package/contracts/settings.schema.json +285 -2
- package/contracts/skill-frontmatter.schema.json +197 -1
- package/dist/contracts.js +13 -0
- package/dist/linters/agent-md.js +29 -1
- package/dist/linters/command-md.js +37 -1
- package/dist/linters/hooks-json.js +24 -0
- package/dist/linters/mcp-json.js +24 -0
- package/dist/linters/skill-md.js +41 -0
- package/dist/plugin-schema.js +7 -0
- package/dist/utils/effort.js +29 -0
- package/dist/utils/frontmatter-keys.js +32 -3
- package/package.json +3 -1
|
@@ -32,6 +32,10 @@ rules:
|
|
|
32
32
|
skill-md/description-max-length: error
|
|
33
33
|
skill-md/description-no-angle-brackets: error
|
|
34
34
|
skill-md/description-trigger-phrases: warning
|
|
35
|
+
skill-md/model-valid: warning
|
|
36
|
+
skill-md/effort-valid: warning
|
|
37
|
+
skill-md/allowed-tools-valid: warning
|
|
38
|
+
skill-md/frontmatter-field-type: warning
|
|
35
39
|
skill-md/no-unknown-frontmatter: warning
|
|
36
40
|
skill-md/body-word-count: warning
|
|
37
41
|
skill-md/body-has-headers: info
|
|
@@ -45,6 +49,9 @@ rules:
|
|
|
45
49
|
agent-md/description-routing-guidance: warning
|
|
46
50
|
agent-md/model-required: error
|
|
47
51
|
agent-md/model-valid: warning
|
|
52
|
+
agent-md/permission-mode-valid: warning
|
|
53
|
+
agent-md/effort-valid: warning
|
|
54
|
+
agent-md/max-turns-valid: warning
|
|
48
55
|
agent-md/color-required: error
|
|
49
56
|
agent-md/color-valid: warning
|
|
50
57
|
agent-md/system-prompt-present: error
|
|
@@ -55,11 +62,16 @@ rules:
|
|
|
55
62
|
command-md/valid-frontmatter: error
|
|
56
63
|
command-md/schema-valid: error
|
|
57
64
|
command-md/description-required: error
|
|
65
|
+
command-md/name-format: warning
|
|
66
|
+
command-md/model-valid: warning
|
|
67
|
+
command-md/effort-valid: warning
|
|
68
|
+
command-md/frontmatter-field-type: warning
|
|
58
69
|
command-md/allowed-tools-valid: warning
|
|
59
70
|
command-md/body-present: warning
|
|
60
71
|
|
|
61
72
|
# ── hooks.json ───────────────────────────────────────────
|
|
62
73
|
hooks-json/valid-json: error
|
|
74
|
+
hooks-json/schema-valid: error
|
|
63
75
|
hooks-json/root-hooks-key: error
|
|
64
76
|
hooks-json/valid-event-names: error
|
|
65
77
|
hooks-json/hook-type-required: error
|
|
@@ -98,6 +110,7 @@ rules:
|
|
|
98
110
|
# ── mcp.json ─────────────────────────────────────────────
|
|
99
111
|
mcp-json/scope-file-name: warning
|
|
100
112
|
mcp-json/valid-json: error
|
|
113
|
+
mcp-json/schema-valid: error
|
|
101
114
|
mcp-json/servers-required: error
|
|
102
115
|
mcp-json/servers-object: error
|
|
103
116
|
mcp-json/server-name-kebab: info
|
package/README.md
CHANGED
|
@@ -130,9 +130,9 @@ No issues found.
|
|
|
130
130
|
| Type | Files | Rules |
|
|
131
131
|
|------|-------|-------|
|
|
132
132
|
| plugin-json | `.claude-plugin/plugin.json` | 13 |
|
|
133
|
-
| skill-md | `skills/*/SKILL.md` |
|
|
134
|
-
| agent-md | `agents/*.md` |
|
|
135
|
-
| command-md | `commands/*.md` |
|
|
133
|
+
| skill-md | `skills/*/SKILL.md` | 16 |
|
|
134
|
+
| agent-md | `agents/*.md` | 20 |
|
|
135
|
+
| command-md | `commands/*.md` | 10 |
|
|
136
136
|
| hooks-json | `hooks/hooks.json` | 9 |
|
|
137
137
|
| settings-json | `.claude-plugin/settings.json` | 25 |
|
|
138
138
|
| mcp-json | `.claude-plugin/mcp.json` | 16 |
|
|
@@ -1,18 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extractedFromClaudeCodeVersion": "2.1.146",
|
|
3
|
-
"extractedAt": "2026-05-
|
|
3
|
+
"extractedAt": "2026-05-22T08:49:59.765Z",
|
|
4
4
|
"schema": {
|
|
5
5
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
6
6
|
"title": "Claude Code agent .md frontmatter",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"name": {
|
|
10
|
+
"anyOf": [
|
|
11
|
+
{
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "number"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "null"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
10
24
|
"description": "Agent identifier. Required — this is how the Agent tool and `--agent` flag address it."
|
|
11
25
|
},
|
|
12
26
|
"description": {
|
|
27
|
+
"anyOf": [
|
|
28
|
+
{
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "number"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "boolean"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "null"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
13
41
|
"description": "When to use this agent. Required — shown in the Agent tool listing."
|
|
14
42
|
},
|
|
15
43
|
"model": {
|
|
44
|
+
"anyOf": [
|
|
45
|
+
{
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "number"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "boolean"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "null"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
16
58
|
"description": "Model override for this agent. Use `inherit` to match the spawning conversation."
|
|
17
59
|
},
|
|
18
60
|
"tools": {
|
|
@@ -70,12 +112,54 @@
|
|
|
70
112
|
"description": "Tools removed from the default set. Ignored if `tools` is set."
|
|
71
113
|
},
|
|
72
114
|
"color": {
|
|
115
|
+
"anyOf": [
|
|
116
|
+
{
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"type": "number"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"type": "boolean"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "null"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
73
129
|
"description": "@internal — display color in the agents UI"
|
|
74
130
|
},
|
|
75
131
|
"effort": {
|
|
132
|
+
"anyOf": [
|
|
133
|
+
{
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "number"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "boolean"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"type": "null"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
76
146
|
"description": "Thinking effort: `low`, `medium`, `high`, `max`, or an integer."
|
|
77
147
|
},
|
|
78
148
|
"permissionMode": {
|
|
149
|
+
"anyOf": [
|
|
150
|
+
{
|
|
151
|
+
"type": "string"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"type": "number"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"type": "boolean"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"type": "null"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
79
163
|
"description": "Permission mode the agent runs in."
|
|
80
164
|
},
|
|
81
165
|
"mcpServers": {
|
|
@@ -126,15 +210,71 @@
|
|
|
126
210
|
"description": "Skills preloaded for this agent."
|
|
127
211
|
},
|
|
128
212
|
"initialPrompt": {
|
|
213
|
+
"anyOf": [
|
|
214
|
+
{
|
|
215
|
+
"type": "string"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"type": "number"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"type": "boolean"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"type": "null"
|
|
225
|
+
}
|
|
226
|
+
],
|
|
129
227
|
"description": "Auto-submitted first message when this agent runs as the main session (via `--agent` or settings). Not read when spawned as a subagent."
|
|
130
228
|
},
|
|
131
229
|
"memory": {
|
|
230
|
+
"anyOf": [
|
|
231
|
+
{
|
|
232
|
+
"type": "string"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"type": "number"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"type": "boolean"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"type": "null"
|
|
242
|
+
}
|
|
243
|
+
],
|
|
132
244
|
"description": "Memory scope: `user`, `project`, or `local`."
|
|
133
245
|
},
|
|
134
246
|
"background": {
|
|
247
|
+
"anyOf": [
|
|
248
|
+
{
|
|
249
|
+
"type": "string"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"type": "number"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"type": "boolean"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"type": "null"
|
|
259
|
+
}
|
|
260
|
+
],
|
|
135
261
|
"description": "If true, the agent runs in the background by default."
|
|
136
262
|
},
|
|
137
263
|
"isolation": {
|
|
264
|
+
"anyOf": [
|
|
265
|
+
{
|
|
266
|
+
"type": "string"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"type": "number"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"type": "boolean"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"type": "null"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
138
278
|
"description": "Filesystem isolation: `worktree` runs in a temporary git worktree."
|
|
139
279
|
}
|
|
140
280
|
},
|
|
@@ -1,18 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extractedFromClaudeCodeVersion": "2.1.146",
|
|
3
|
-
"extractedAt": "2026-05-
|
|
3
|
+
"extractedAt": "2026-05-22T08:49:59.767Z",
|
|
4
4
|
"schema": {
|
|
5
5
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
6
6
|
"title": "Claude Code command .md frontmatter",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"name": {
|
|
10
|
+
"anyOf": [
|
|
11
|
+
{
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "number"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "null"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
10
24
|
"description": "Display name. Defaults to the filename without extension."
|
|
11
25
|
},
|
|
12
26
|
"description": {
|
|
27
|
+
"anyOf": [
|
|
28
|
+
{
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "number"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "boolean"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "null"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
13
41
|
"description": "One-line summary shown in listings and the Skill tool."
|
|
14
42
|
},
|
|
15
43
|
"model": {
|
|
44
|
+
"anyOf": [
|
|
45
|
+
{
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "number"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "boolean"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "null"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
16
58
|
"description": "Model override (`haiku`, `sonnet`, `opus`, or a full ID). Use `inherit` to match the parent conversation."
|
|
17
59
|
},
|
|
18
60
|
"allowed-tools": {
|
|
@@ -43,6 +85,20 @@
|
|
|
43
85
|
"description": "Tools available to the model while this file is active. Comma-separated string or YAML list."
|
|
44
86
|
},
|
|
45
87
|
"argument-hint": {
|
|
88
|
+
"anyOf": [
|
|
89
|
+
{
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "number"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"type": "boolean"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"type": "null"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
46
102
|
"description": "Placeholder text shown after the slash command name."
|
|
47
103
|
},
|
|
48
104
|
"arguments": {
|
|
@@ -73,18 +129,88 @@
|
|
|
73
129
|
"description": "@internal — typed variant of argument-hint; argument-hint is the documented form"
|
|
74
130
|
},
|
|
75
131
|
"disable-model-invocation": {
|
|
132
|
+
"anyOf": [
|
|
133
|
+
{
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "number"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "boolean"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"type": "null"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
76
146
|
"description": "If true, the model cannot invoke this via the Skill tool; only users can type the slash command."
|
|
77
147
|
},
|
|
78
148
|
"user-invocable": {
|
|
149
|
+
"anyOf": [
|
|
150
|
+
{
|
|
151
|
+
"type": "string"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"type": "number"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"type": "boolean"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"type": "null"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
79
163
|
"description": "If false, hides the slash command from users; only the model can invoke it via the Skill tool."
|
|
80
164
|
},
|
|
81
165
|
"effort": {
|
|
166
|
+
"anyOf": [
|
|
167
|
+
{
|
|
168
|
+
"type": "string"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"type": "number"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"type": "boolean"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"type": "null"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
82
180
|
"description": "Thinking effort for the model: `low`, `medium`, `high`, `max`, or an integer."
|
|
83
181
|
},
|
|
84
182
|
"shell": {
|
|
183
|
+
"anyOf": [
|
|
184
|
+
{
|
|
185
|
+
"type": "string"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"type": "number"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"type": "boolean"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"type": "null"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
85
197
|
"description": "Shell for `!`-command blocks: `bash` or `powershell`. Defaults to bash regardless of platform."
|
|
86
198
|
},
|
|
87
199
|
"version": {
|
|
200
|
+
"anyOf": [
|
|
201
|
+
{
|
|
202
|
+
"type": "string"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"type": "number"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"type": "boolean"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "null"
|
|
212
|
+
}
|
|
213
|
+
],
|
|
88
214
|
"description": "@internal — bookkeeping, not surfaced to users"
|
|
89
215
|
}
|
|
90
216
|
},
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extractedFromClaudeCodeVersion": "2.1.146",
|
|
3
|
+
"extractedAt": "2026-05-22T08:16:43.683Z",
|
|
4
|
+
"schema": {
|
|
5
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
6
|
+
"title": "Claude Code hooks.json",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"hooks": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"matcher": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "String pattern to match (e.g. tool names like \"Write\")"
|
|
19
|
+
},
|
|
20
|
+
"hooks": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"oneOf": [
|
|
24
|
+
{
|
|
25
|
+
"type": "object",
|
|
26
|
+
"properties": {
|
|
27
|
+
"type": {
|
|
28
|
+
"const": "command",
|
|
29
|
+
"description": "Shell command hook type"
|
|
30
|
+
},
|
|
31
|
+
"command": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Shell command to execute"
|
|
34
|
+
},
|
|
35
|
+
"args": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
40
|
+
"description": "Argument list for exec form. When present, `command` is resolved as \"+\"an executable and spawned directly with these arguments \\u2014 no shell. \"+\"Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."
|
|
41
|
+
},
|
|
42
|
+
"if": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands."
|
|
45
|
+
},
|
|
46
|
+
"shell": {
|
|
47
|
+
"enum": [
|
|
48
|
+
"bash",
|
|
49
|
+
"powershell"
|
|
50
|
+
],
|
|
51
|
+
"description": "Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."
|
|
52
|
+
},
|
|
53
|
+
"timeout": {
|
|
54
|
+
"type": "number",
|
|
55
|
+
"description": "Timeout in seconds for this specific command"
|
|
56
|
+
},
|
|
57
|
+
"statusMessage": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Custom status message to display in spinner while hook runs"
|
|
60
|
+
},
|
|
61
|
+
"once": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"description": "If true, hook runs once and is removed after execution"
|
|
64
|
+
},
|
|
65
|
+
"async": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"description": "If true, hook runs in background without blocking"
|
|
68
|
+
},
|
|
69
|
+
"asyncRewake": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"description": "If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."
|
|
72
|
+
},
|
|
73
|
+
"rewakeMessage": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"minLength": 1,
|
|
76
|
+
"description": "@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."
|
|
77
|
+
},
|
|
78
|
+
"rewakeSummary": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"minLength": 1,
|
|
81
|
+
"description": "@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to \"Stop hook feedback\"."
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"required": [
|
|
85
|
+
"type",
|
|
86
|
+
"command"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "object",
|
|
91
|
+
"properties": {
|
|
92
|
+
"type": {
|
|
93
|
+
"const": "prompt",
|
|
94
|
+
"description": "LLM prompt hook type"
|
|
95
|
+
},
|
|
96
|
+
"prompt": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"description": "Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."
|
|
99
|
+
},
|
|
100
|
+
"if": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands."
|
|
103
|
+
},
|
|
104
|
+
"timeout": {
|
|
105
|
+
"type": "number",
|
|
106
|
+
"description": "Timeout in seconds for this specific prompt evaluation"
|
|
107
|
+
},
|
|
108
|
+
"model": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"description": "Model to use for this prompt hook (e.g., \"claude-sonnet-4-6\"). If not specified, uses the default small fast model."
|
|
111
|
+
},
|
|
112
|
+
"continueOnBlock": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"description": "`Sets the continue value for the decision:\"block\" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:\"block\" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`"
|
|
115
|
+
},
|
|
116
|
+
"statusMessage": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Custom status message to display in spinner while hook runs"
|
|
119
|
+
},
|
|
120
|
+
"once": {
|
|
121
|
+
"type": "boolean",
|
|
122
|
+
"description": "If true, hook runs once and is removed after execution"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": [
|
|
126
|
+
"type",
|
|
127
|
+
"prompt"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"type": "object",
|
|
132
|
+
"properties": {
|
|
133
|
+
"type": {
|
|
134
|
+
"const": "agent",
|
|
135
|
+
"description": "Agentic verifier hook type"
|
|
136
|
+
},
|
|
137
|
+
"prompt": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"description": "Prompt describing what to verify (e.g. \"Verify that unit tests ran and passed.\"). Use $ARGUMENTS placeholder for hook input JSON."
|
|
140
|
+
},
|
|
141
|
+
"if": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands."
|
|
144
|
+
},
|
|
145
|
+
"timeout": {
|
|
146
|
+
"type": "number",
|
|
147
|
+
"description": "Timeout in seconds for agent execution (default 60)"
|
|
148
|
+
},
|
|
149
|
+
"model": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"description": "Model to use for this agent hook (e.g., \"claude-sonnet-4-6\"). If not specified, uses Haiku."
|
|
152
|
+
},
|
|
153
|
+
"statusMessage": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"description": "Custom status message to display in spinner while hook runs"
|
|
156
|
+
},
|
|
157
|
+
"once": {
|
|
158
|
+
"type": "boolean",
|
|
159
|
+
"description": "If true, hook runs once and is removed after execution"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"required": [
|
|
163
|
+
"type",
|
|
164
|
+
"prompt"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"type": "object",
|
|
169
|
+
"properties": {
|
|
170
|
+
"type": {
|
|
171
|
+
"const": "http",
|
|
172
|
+
"description": "HTTP hook type"
|
|
173
|
+
},
|
|
174
|
+
"url": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"format": "uri",
|
|
177
|
+
"description": "URL to POST the hook input JSON to"
|
|
178
|
+
},
|
|
179
|
+
"if": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands."
|
|
182
|
+
},
|
|
183
|
+
"timeout": {
|
|
184
|
+
"type": "number",
|
|
185
|
+
"description": "Timeout in seconds for this specific request"
|
|
186
|
+
},
|
|
187
|
+
"headers": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"additionalProperties": {
|
|
190
|
+
"type": "string"
|
|
191
|
+
},
|
|
192
|
+
"description": "Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., \"Authorization\": \"Bearer $MY_TOKEN\"). Only variables listed in allowedEnvVars will be interpolated."
|
|
193
|
+
},
|
|
194
|
+
"allowedEnvVars": {
|
|
195
|
+
"type": "array",
|
|
196
|
+
"items": {
|
|
197
|
+
"type": "string"
|
|
198
|
+
},
|
|
199
|
+
"description": "Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."
|
|
200
|
+
},
|
|
201
|
+
"statusMessage": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"description": "Custom status message to display in spinner while hook runs"
|
|
204
|
+
},
|
|
205
|
+
"once": {
|
|
206
|
+
"type": "boolean",
|
|
207
|
+
"description": "If true, hook runs once and is removed after execution"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"required": [
|
|
211
|
+
"type",
|
|
212
|
+
"url"
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"type": "object",
|
|
217
|
+
"properties": {
|
|
218
|
+
"type": {
|
|
219
|
+
"const": "mcp_tool",
|
|
220
|
+
"description": "MCP tool hook type"
|
|
221
|
+
},
|
|
222
|
+
"server": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"description": "Name of an already-configured MCP server to invoke"
|
|
225
|
+
},
|
|
226
|
+
"tool": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"description": "Name of the tool on that server to call"
|
|
229
|
+
},
|
|
230
|
+
"input": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"additionalProperties": {},
|
|
233
|
+
"description": "Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. \"${tool_input.file_path}\")."
|
|
234
|
+
},
|
|
235
|
+
"if": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands."
|
|
238
|
+
},
|
|
239
|
+
"timeout": {
|
|
240
|
+
"type": "number",
|
|
241
|
+
"description": "Timeout in seconds for this specific tool call"
|
|
242
|
+
},
|
|
243
|
+
"statusMessage": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"description": "Custom status message to display in spinner while hook runs"
|
|
246
|
+
},
|
|
247
|
+
"once": {
|
|
248
|
+
"type": "boolean",
|
|
249
|
+
"description": "If true, hook runs once and is removed after execution"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"required": [
|
|
253
|
+
"type",
|
|
254
|
+
"server",
|
|
255
|
+
"tool"
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
|
+
"description": "List of hooks to execute when the matcher matches"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"required": [
|
|
264
|
+
"hooks"
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"required": [
|
|
271
|
+
"hooks"
|
|
272
|
+
],
|
|
273
|
+
"description": "Claude Code hooks/hooks.json. The `hooks` key maps hook-event names (PreToolUse, PostToolUse, …) to arrays of matcher entries, each holding a list of hook definitions (command / prompt / http / agent / mcp_tool). Same shape as the `hooks` block inside settings.json. Validates the structure of known fields; unknown hook fields are not schema errors — the advisory hooks-json hand-written rules report those."
|
|
274
|
+
}
|
|
275
|
+
}
|