claude-all-hands 1.0.1 → 1.0.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.
Files changed (160) hide show
  1. package/.claude/agents/code-simplifier.md +52 -0
  2. package/.claude/agents/curator.md +189 -245
  3. package/.claude/agents/documentor.md +147 -0
  4. package/.claude/agents/planner.md +123 -166
  5. package/.claude/agents/researcher.md +58 -41
  6. package/.claude/agents/surveyor.md +81 -0
  7. package/.claude/agents/worker.md +74 -0
  8. package/.claude/commands/audit-docs.md +94 -0
  9. package/.claude/commands/continue.md +120 -0
  10. package/.claude/commands/create-docs.md +100 -0
  11. package/.claude/commands/create-skill.md +107 -0
  12. package/.claude/commands/create-specialist.md +111 -0
  13. package/.claude/commands/curator-audit.md +4 -0
  14. package/.claude/commands/debug.md +183 -0
  15. package/.claude/commands/plan.md +199 -102
  16. package/.claude/commands/validate.md +11 -0
  17. package/.claude/commands/whats-next.md +106 -134
  18. package/.claude/envoy/envoy +11 -14
  19. package/.claude/envoy/package-lock.json +1388 -0
  20. package/.claude/envoy/package.json +29 -0
  21. package/.claude/envoy/src/cli.ts +126 -0
  22. package/.claude/envoy/src/commands/base.ts +216 -0
  23. package/.claude/envoy/src/commands/gemini.ts +999 -0
  24. package/.claude/envoy/src/commands/git.ts +639 -0
  25. package/.claude/envoy/src/commands/index.ts +73 -0
  26. package/.claude/envoy/src/commands/knowledge.ts +187 -0
  27. package/.claude/envoy/src/commands/perplexity.ts +129 -0
  28. package/.claude/envoy/src/commands/plan/core.ts +134 -0
  29. package/.claude/envoy/src/commands/plan/findings.ts +446 -0
  30. package/.claude/envoy/src/commands/plan/gates.ts +672 -0
  31. package/.claude/envoy/src/commands/plan/index.ts +135 -0
  32. package/.claude/envoy/src/commands/plan/lifecycle.ts +648 -0
  33. package/.claude/envoy/src/commands/plan/plan-file.ts +138 -0
  34. package/.claude/envoy/src/commands/plan/prompts.ts +285 -0
  35. package/.claude/envoy/src/commands/plan/protocols.ts +166 -0
  36. package/.claude/envoy/src/commands/repomix.ts +99 -0
  37. package/.claude/envoy/src/commands/tavily.ts +220 -0
  38. package/.claude/envoy/src/commands/xai.ts +168 -0
  39. package/.claude/envoy/src/lib/design.ts +41 -0
  40. package/.claude/envoy/src/lib/feedback-schemas.ts +154 -0
  41. package/.claude/envoy/src/lib/findings.ts +215 -0
  42. package/.claude/envoy/src/lib/gates.ts +572 -0
  43. package/.claude/envoy/src/lib/git.ts +132 -0
  44. package/.claude/envoy/src/lib/index.ts +188 -0
  45. package/.claude/envoy/src/lib/knowledge.ts +594 -0
  46. package/.claude/envoy/src/lib/markdown.ts +75 -0
  47. package/.claude/envoy/src/lib/observability.ts +262 -0
  48. package/.claude/envoy/src/lib/paths.ts +130 -0
  49. package/.claude/envoy/src/lib/plan-io.ts +117 -0
  50. package/.claude/envoy/src/lib/prompts.ts +231 -0
  51. package/.claude/envoy/src/lib/protocols.ts +314 -0
  52. package/.claude/envoy/src/lib/repomix.ts +133 -0
  53. package/.claude/envoy/src/lib/retry.ts +138 -0
  54. package/.claude/envoy/src/lib/watcher.ts +167 -0
  55. package/.claude/envoy/tsconfig.json +21 -0
  56. package/.claude/hooks/scripts/scan_agents.py +62 -0
  57. package/.claude/hooks/scripts/scan_commands.py +50 -0
  58. package/.claude/hooks/scripts/scan_skills.py +46 -70
  59. package/.claude/hooks/scripts/validate_artifacts.py +128 -0
  60. package/.claude/hooks/startup.sh +26 -24
  61. package/.claude/protocols/bug-discovery.yaml +55 -0
  62. package/.claude/protocols/debugging.yaml +51 -0
  63. package/.claude/protocols/discovery.yaml +53 -0
  64. package/.claude/protocols/implementation.yaml +84 -0
  65. package/.claude/settings.json +37 -97
  66. package/.claude/skills/brainstorming/SKILL.md +54 -0
  67. package/.claude/skills/commands-development/SKILL.md +630 -0
  68. package/.claude/skills/commands-development/references/arguments.md +252 -0
  69. package/.claude/skills/commands-development/references/patterns.md +796 -0
  70. package/.claude/skills/commands-development/references/tool-restrictions.md +376 -0
  71. package/.claude/skills/discovery-mode/SKILL.md +108 -0
  72. package/.claude/skills/hooks-development/SKILL.md +332 -0
  73. package/.claude/skills/hooks-development/references/command-vs-prompt.md +269 -0
  74. package/.claude/skills/hooks-development/references/examples.md +658 -0
  75. package/.claude/skills/hooks-development/references/hook-types.md +463 -0
  76. package/.claude/skills/hooks-development/references/input-output-schemas.md +469 -0
  77. package/.claude/skills/hooks-development/references/matchers.md +470 -0
  78. package/.claude/skills/hooks-development/references/troubleshooting.md +587 -0
  79. package/.claude/skills/implementation-mode/SKILL.md +171 -0
  80. package/.claude/skills/research-tools/SKILL.md +35 -33
  81. package/.claude/skills/skills-development/SKILL.md +192 -0
  82. package/.claude/skills/skills-development/references/api-security.md +226 -0
  83. package/.claude/skills/skills-development/references/be-clear-and-direct.md +531 -0
  84. package/.claude/skills/skills-development/references/common-patterns.md +595 -0
  85. package/.claude/skills/skills-development/references/core-principles.md +437 -0
  86. package/.claude/skills/skills-development/references/executable-code.md +175 -0
  87. package/.claude/skills/skills-development/references/iteration-and-testing.md +474 -0
  88. package/.claude/skills/skills-development/references/recommended-structure.md +168 -0
  89. package/.claude/skills/skills-development/references/skill-structure.md +372 -0
  90. package/.claude/skills/skills-development/references/use-xml-tags.md +466 -0
  91. package/.claude/skills/skills-development/references/using-scripts.md +113 -0
  92. package/.claude/skills/skills-development/references/using-templates.md +112 -0
  93. package/.claude/skills/skills-development/references/workflows-and-validation.md +510 -0
  94. package/.claude/skills/skills-development/templates/router-skill.md +73 -0
  95. package/.claude/skills/skills-development/templates/simple-skill.md +33 -0
  96. package/.claude/skills/skills-development/workflows/add-reference.md +96 -0
  97. package/.claude/skills/skills-development/workflows/add-script.md +93 -0
  98. package/.claude/skills/skills-development/workflows/add-template.md +74 -0
  99. package/.claude/skills/skills-development/workflows/add-workflow.md +120 -0
  100. package/.claude/skills/skills-development/workflows/audit-skill.md +138 -0
  101. package/.claude/skills/skills-development/workflows/create-domain-expertise-skill.md +605 -0
  102. package/.claude/skills/skills-development/workflows/create-new-skill.md +191 -0
  103. package/.claude/skills/skills-development/workflows/get-guidance.md +121 -0
  104. package/.claude/skills/skills-development/workflows/upgrade-to-router.md +161 -0
  105. package/.claude/skills/skills-development/workflows/verify-skill.md +204 -0
  106. package/.claude/skills/subagents-development/SKILL.md +325 -0
  107. package/.claude/skills/subagents-development/references/context-management.md +567 -0
  108. package/.claude/skills/subagents-development/references/debugging-agents.md +714 -0
  109. package/.claude/skills/subagents-development/references/error-handling-and-recovery.md +502 -0
  110. package/.claude/skills/subagents-development/references/evaluation-and-testing.md +374 -0
  111. package/.claude/skills/subagents-development/references/orchestration-patterns.md +591 -0
  112. package/.claude/skills/subagents-development/references/subagents.md +508 -0
  113. package/.claude/skills/subagents-development/references/writing-subagent-prompts.md +517 -0
  114. package/.claude/statusline.sh +24 -0
  115. package/bin/cli.js +110 -72
  116. package/package.json +1 -1
  117. package/.claude/agents/explorer.md +0 -62
  118. package/.claude/agents/parallel-worker.md +0 -121
  119. package/.claude/commands/curation-fix.md +0 -92
  120. package/.claude/commands/new-branch.md +0 -36
  121. package/.claude/commands/parallel-discovery.md +0 -69
  122. package/.claude/commands/parallel-orchestration.md +0 -99
  123. package/.claude/commands/plan-checkpoint.md +0 -37
  124. package/.claude/envoy/commands/__init__.py +0 -1
  125. package/.claude/envoy/commands/base.py +0 -95
  126. package/.claude/envoy/commands/parallel.py +0 -439
  127. package/.claude/envoy/commands/perplexity.py +0 -86
  128. package/.claude/envoy/commands/plans.py +0 -451
  129. package/.claude/envoy/commands/tavily.py +0 -156
  130. package/.claude/envoy/commands/vertex.py +0 -358
  131. package/.claude/envoy/commands/xai.py +0 -124
  132. package/.claude/envoy/envoy.py +0 -122
  133. package/.claude/envoy/pyrightconfig.json +0 -4
  134. package/.claude/envoy/requirements.txt +0 -2
  135. package/.claude/hooks/capture-queries.sh +0 -3
  136. package/.claude/hooks/scripts/enforce_planning.py +0 -118
  137. package/.claude/hooks/scripts/enforce_rg.py +0 -34
  138. package/.claude/hooks/scripts/validate_skill.py +0 -81
  139. package/.claude/skills/claude-envoy-curation/SKILL.md +0 -162
  140. package/.claude/skills/claude-envoy-usage/SKILL.md +0 -46
  141. package/.claude/skills/command-development/SKILL.md +0 -206
  142. package/.claude/skills/command-development/examples/simple-commands.md +0 -212
  143. package/.claude/skills/command-development/references/frontmatter-reference.md +0 -221
  144. package/.claude/skills/hook-development/SKILL.md +0 -127
  145. package/.claude/skills/hook-development/examples/command-hooks.md +0 -301
  146. package/.claude/skills/hook-development/examples/prompt-hooks.md +0 -114
  147. package/.claude/skills/hook-development/references/event-reference.md +0 -226
  148. package/.claude/skills/repomix-extraction/SKILL.md +0 -91
  149. package/.claude/skills/skill-development/SKILL.md +0 -168
  150. package/.claude/skills/skill-development/examples/complete-skill-examples.md +0 -281
  151. package/.claude/skills/skill-development/references/progressive-disclosure.md +0 -141
  152. package/.claude/skills/skill-development/references/writing-style.md +0 -180
  153. package/.claude/skills/skill-development/scripts/validate-skill.sh +0 -144
  154. package/.claude/skills/specialist-builder/SKILL.md +0 -327
  155. package/.claude/skills/specialist-builder/docs/agent-catalog.md +0 -28
  156. package/.claude/skills/specialist-builder/examples/complete-agent-examples.md +0 -206
  157. package/.claude/skills/specialist-builder/references/system-prompt-patterns.md +0 -281
  158. package/.claude/skills/specialist-builder/references/triggering-examples.md +0 -162
  159. package/.claude/skills/specialist-builder/scripts/validate-agent.sh +0 -137
  160. /package/.claude/{envoy/claude-envoy.py → skills/claude-envoy-patterns/SKILL.md} +0 -0
@@ -0,0 +1,469 @@
1
+ # Input/Output Schemas
2
+
3
+ Complete JSON schemas for all hook types.
4
+
5
+ ## Common Input Fields
6
+
7
+ All hooks receive these fields:
8
+
9
+ ```typescript
10
+ {
11
+ session_id: string // Unique session identifier
12
+ transcript_path: string // Path to session transcript (.jsonl file)
13
+ cwd: string // Current working directory
14
+ permission_mode: string // "default" | "plan" | "acceptEdits" | "bypassPermissions"
15
+ hook_event_name: string // Name of the hook event
16
+ }
17
+ ```
18
+
19
+ ---
20
+
21
+ ## PreToolUse
22
+
23
+ **Input**:
24
+ ```json
25
+ {
26
+ "session_id": "abc123",
27
+ "transcript_path": "~/.claude/projects/.../session.jsonl",
28
+ "cwd": "/Users/username/project",
29
+ "permission_mode": "default",
30
+ "hook_event_name": "PreToolUse",
31
+ "tool_name": "Bash",
32
+ "tool_input": {
33
+ "command": "npm install",
34
+ "description": "Install dependencies"
35
+ }
36
+ }
37
+ ```
38
+
39
+ **Output** (optional, for control):
40
+ ```json
41
+ {
42
+ "decision": "approve" | "block",
43
+ "reason": "Explanation for the decision",
44
+ "permissionDecision": "allow" | "deny" | "ask",
45
+ "permissionDecisionReason": "Why this permission decision",
46
+ "updatedInput": {
47
+ "command": "npm install --save-exact"
48
+ },
49
+ "systemMessage": "Message displayed to user",
50
+ "suppressOutput": false,
51
+ "continue": true
52
+ }
53
+ ```
54
+
55
+ **Fields**:
56
+ - `decision`: Whether to allow the tool call
57
+ - `reason`: Explanation (required if blocking)
58
+ - `permissionDecision`: Override permission system
59
+ - `updatedInput`: Modified tool input (partial update)
60
+ - `systemMessage`: Message shown to user
61
+ - `suppressOutput`: Hide hook output from user
62
+ - `continue`: If false, stop execution
63
+
64
+ ---
65
+
66
+ ## PostToolUse
67
+
68
+ **Input**:
69
+ ```json
70
+ {
71
+ "session_id": "abc123",
72
+ "transcript_path": "~/.claude/projects/.../session.jsonl",
73
+ "cwd": "/Users/username/project",
74
+ "permission_mode": "default",
75
+ "hook_event_name": "PostToolUse",
76
+ "tool_name": "Write",
77
+ "tool_input": {
78
+ "file_path": "/path/to/file.js",
79
+ "content": "const x = 1;"
80
+ },
81
+ "tool_output": "File created successfully at: /path/to/file.js"
82
+ }
83
+ ```
84
+
85
+ **Output** (optional):
86
+ ```json
87
+ {
88
+ "systemMessage": "Code formatted successfully",
89
+ "suppressOutput": false
90
+ }
91
+ ```
92
+
93
+ **Fields**:
94
+ - `systemMessage`: Additional message to display
95
+ - `suppressOutput`: Hide tool output from user
96
+
97
+ ---
98
+
99
+ ## UserPromptSubmit
100
+
101
+ **Input**:
102
+ ```json
103
+ {
104
+ "session_id": "abc123",
105
+ "transcript_path": "~/.claude/projects/.../session.jsonl",
106
+ "cwd": "/Users/username/project",
107
+ "permission_mode": "default",
108
+ "hook_event_name": "UserPromptSubmit",
109
+ "prompt": "Write a function to calculate factorial"
110
+ }
111
+ ```
112
+
113
+ **Output**:
114
+ ```json
115
+ {
116
+ "decision": "approve" | "block",
117
+ "reason": "Prompt is clear and actionable",
118
+ "systemMessage": "Optional message to user"
119
+ }
120
+ ```
121
+
122
+ **Fields**:
123
+ - `decision`: Whether to allow the prompt
124
+ - `reason`: Explanation (required if blocking)
125
+ - `systemMessage`: Message shown to user
126
+
127
+ ---
128
+
129
+ ## Stop
130
+
131
+ **Input**:
132
+ ```json
133
+ {
134
+ "session_id": "abc123",
135
+ "transcript_path": "~/.claude/projects/.../session.jsonl",
136
+ "cwd": "/Users/username/project",
137
+ "permission_mode": "default",
138
+ "hook_event_name": "Stop",
139
+ "stop_hook_active": false
140
+ }
141
+ ```
142
+
143
+ **Output**:
144
+ ```json
145
+ {
146
+ "decision": "block" | undefined,
147
+ "reason": "Tests are still failing - please fix before stopping",
148
+ "continue": true,
149
+ "stopReason": "Cannot stop yet",
150
+ "systemMessage": "Additional context"
151
+ }
152
+ ```
153
+
154
+ **Fields**:
155
+ - `decision`: `"block"` to prevent stopping, `undefined` to allow
156
+ - `reason`: Why Claude should continue (required if blocking)
157
+ - `continue`: If true and blocking, Claude continues working
158
+ - `stopReason`: Message shown when stopping is blocked
159
+ - `systemMessage`: Additional context for Claude
160
+ - `stop_hook_active`: If true, don't block again (prevents infinite loops)
161
+
162
+ **Important**: Always check `stop_hook_active` to avoid infinite loops:
163
+
164
+ ```javascript
165
+ if (input.stop_hook_active) {
166
+ return { decision: undefined }; // Don't block again
167
+ }
168
+ ```
169
+
170
+ ---
171
+
172
+ ## SubagentStop
173
+
174
+ **Input**: Same as Stop
175
+
176
+ **Output**: Same as Stop
177
+
178
+ **Usage**: Same as Stop, but for subagent completion
179
+
180
+ ---
181
+
182
+ ## SessionStart
183
+
184
+ **Input**:
185
+ ```json
186
+ {
187
+ "session_id": "abc123",
188
+ "transcript_path": "~/.claude/projects/.../session.jsonl",
189
+ "cwd": "/Users/username/project",
190
+ "permission_mode": "default",
191
+ "hook_event_name": "SessionStart",
192
+ "source": "startup" | "continue" | "checkpoint"
193
+ }
194
+ ```
195
+
196
+ **Output**:
197
+ ```json
198
+ {
199
+ "hookSpecificOutput": {
200
+ "hookEventName": "SessionStart",
201
+ "additionalContext": "Current sprint: Sprint 23\nFocus: User authentication\nDeadline: Friday"
202
+ }
203
+ }
204
+ ```
205
+
206
+ **Fields**:
207
+ - `additionalContext`: Text injected into session context
208
+ - Multiple SessionStart hooks' contexts are concatenated
209
+
210
+ ---
211
+
212
+ ## SessionEnd
213
+
214
+ **Input**:
215
+ ```json
216
+ {
217
+ "session_id": "abc123",
218
+ "transcript_path": "~/.claude/projects/.../session.jsonl",
219
+ "cwd": "/Users/username/project",
220
+ "permission_mode": "default",
221
+ "hook_event_name": "SessionEnd",
222
+ "reason": "exit" | "error" | "timeout" | "compact"
223
+ }
224
+ ```
225
+
226
+ **Output**: None (ignored)
227
+
228
+ **Usage**: Cleanup tasks only. Cannot prevent session end.
229
+
230
+ ---
231
+
232
+ ## PreCompact
233
+
234
+ **Input**:
235
+ ```json
236
+ {
237
+ "session_id": "abc123",
238
+ "transcript_path": "~/.claude/projects/.../session.jsonl",
239
+ "cwd": "/Users/username/project",
240
+ "permission_mode": "default",
241
+ "hook_event_name": "PreCompact",
242
+ "trigger": "manual" | "auto",
243
+ "custom_instructions": "Preserve all git commit messages"
244
+ }
245
+ ```
246
+
247
+ **Output**:
248
+ ```json
249
+ {
250
+ "decision": "approve" | "block",
251
+ "reason": "Safe to compact" | "Wait until task completes"
252
+ }
253
+ ```
254
+
255
+ **Fields**:
256
+ - `trigger`: How compaction was initiated
257
+ - `custom_instructions`: User's compaction preferences (if manual)
258
+ - `decision`: Whether to proceed with compaction
259
+ - `reason`: Explanation
260
+
261
+ ---
262
+
263
+ ## Notification
264
+
265
+ **Input**:
266
+ ```json
267
+ {
268
+ "session_id": "abc123",
269
+ "transcript_path": "~/.claude/projects/.../session.jsonl",
270
+ "cwd": "/Users/username/project",
271
+ "permission_mode": "default",
272
+ "hook_event_name": "Notification"
273
+ }
274
+ ```
275
+
276
+ **Output**: None (hook just performs notification action)
277
+
278
+ **Usage**: Trigger external notifications (desktop, sound, status bar)
279
+
280
+ ---
281
+
282
+ ## Common Output Fields
283
+
284
+ These fields can be returned by any hook:
285
+
286
+ ```json
287
+ {
288
+ "continue": true | false,
289
+ "stopReason": "Reason shown when stopping",
290
+ "suppressOutput": true | false,
291
+ "systemMessage": "Additional context or message"
292
+ }
293
+ ```
294
+
295
+ **Fields**:
296
+ - `continue`: If false, stop Claude's execution immediately
297
+ - `stopReason`: Message displayed when execution stops
298
+ - `suppressOutput`: If true, hide hook's stdout/stderr from user
299
+ - `systemMessage`: Context added to Claude's next message
300
+
301
+ ---
302
+
303
+ ## LLM Prompt Hook Response
304
+
305
+ When using `type: "prompt"`, the LLM must return JSON:
306
+
307
+ ```json
308
+ {
309
+ "decision": "approve" | "block",
310
+ "reason": "Detailed explanation",
311
+ "systemMessage": "Optional message",
312
+ "continue": true | false,
313
+ "stopReason": "Optional stop message"
314
+ }
315
+ ```
316
+
317
+ **Example prompt**:
318
+ ```
319
+ Evaluate this command: $ARGUMENTS
320
+
321
+ Check if it's safe to execute.
322
+
323
+ Return JSON:
324
+ {
325
+ "decision": "approve" or "block",
326
+ "reason": "your explanation"
327
+ }
328
+ ```
329
+
330
+ The `$ARGUMENTS` placeholder is replaced with the hook's input JSON.
331
+
332
+ ---
333
+
334
+ ## Tool-Specific Input Fields
335
+
336
+ Different tools provide different `tool_input` fields:
337
+
338
+ ### Bash
339
+ ```json
340
+ {
341
+ "tool_input": {
342
+ "command": "npm install",
343
+ "description": "Install dependencies",
344
+ "timeout": 120000,
345
+ "run_in_background": false
346
+ }
347
+ }
348
+ ```
349
+
350
+ ### Write
351
+ ```json
352
+ {
353
+ "tool_input": {
354
+ "file_path": "/path/to/file.js",
355
+ "content": "const x = 1;"
356
+ }
357
+ }
358
+ ```
359
+
360
+ ### Edit
361
+ ```json
362
+ {
363
+ "tool_input": {
364
+ "file_path": "/path/to/file.js",
365
+ "old_string": "const x = 1;",
366
+ "new_string": "const x = 2;",
367
+ "replace_all": false
368
+ }
369
+ }
370
+ ```
371
+
372
+ ### Read
373
+ ```json
374
+ {
375
+ "tool_input": {
376
+ "file_path": "/path/to/file.js",
377
+ "offset": 0,
378
+ "limit": 100
379
+ }
380
+ }
381
+ ```
382
+
383
+ ### Grep
384
+ ```json
385
+ {
386
+ "tool_input": {
387
+ "pattern": "function.*",
388
+ "path": "/path/to/search",
389
+ "output_mode": "content"
390
+ }
391
+ }
392
+ ```
393
+
394
+ ### MCP tools
395
+ ```json
396
+ {
397
+ "tool_input": {
398
+ // MCP tool-specific parameters
399
+ }
400
+ }
401
+ ```
402
+
403
+ Access these in hooks:
404
+ ```bash
405
+ command=$(echo "$input" | jq -r '.tool_input.command')
406
+ file_path=$(echo "$input" | jq -r '.tool_input.file_path')
407
+ ```
408
+
409
+ ---
410
+
411
+ ## Modifying Tool Input
412
+
413
+ PreToolUse hooks can modify `tool_input` before execution:
414
+
415
+ **Original input**:
416
+ ```json
417
+ {
418
+ "tool_input": {
419
+ "command": "npm install lodash"
420
+ }
421
+ }
422
+ ```
423
+
424
+ **Hook output**:
425
+ ```json
426
+ {
427
+ "decision": "approve",
428
+ "reason": "Adding --save-exact flag",
429
+ "updatedInput": {
430
+ "command": "npm install --save-exact lodash"
431
+ }
432
+ }
433
+ ```
434
+
435
+ **Result**: Tool executes with modified input.
436
+
437
+ **Partial updates**: Only specify fields you want to change:
438
+ ```json
439
+ {
440
+ "updatedInput": {
441
+ "timeout": 300000 // Only update timeout, keep other fields
442
+ }
443
+ }
444
+ ```
445
+
446
+ ---
447
+
448
+ ## Error Handling
449
+
450
+ **Command hooks**: Return non-zero exit code to indicate error
451
+ ```bash
452
+ if [ error ]; then
453
+ echo '{"decision": "block", "reason": "Error occurred"}' >&2
454
+ exit 1
455
+ fi
456
+ ```
457
+
458
+ **Prompt hooks**: LLM should return valid JSON. If malformed, hook fails gracefully.
459
+
460
+ **Timeout**: Set `timeout` (ms) to prevent hanging:
461
+ ```json
462
+ {
463
+ "type": "command",
464
+ "command": "/path/to/slow-script.sh",
465
+ "timeout": 30000
466
+ }
467
+ ```
468
+
469
+ Default: 60000ms (60s)