-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Phase 2: Prompt & Agent Hook Handler Types
Context
Claude Code now supports two LLM-based hook handler types:
type: "prompt"— single-turn LLM evaluation returning a yes/no decisiontype: "agent"— spawns a subagent with tool access (Read, Grep, Glob) to verify conditions
New Fields (shared by both types)
| Field | Type | Description |
|---|---|---|
type |
"prompt" or "agent" |
Handler type |
prompt |
String |
Prompt text. $ARGUMENTS placeholder for hook input JSON |
model |
String? |
Model to use (defaults to a fast model) |
Timeout Defaults
prompt: 30 secondsagent: 60 seconds
Example (prompt)
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: prompt
prompt: "Review this bash command for safety: $ARGUMENTS"
model: haikuFiles to Modify
Sources/mcs/Core/Settings.swift— extendHookEntryto supportpromptandmodelfieldsSources/mcs/ExternalPack/ExternalPackManifest.swift— allow packs to define prompt/agent hooks- Validation: if
type == "prompt"ortype == "agent",promptis required - Tests
Acceptance Criteria
-
HookEntrycan represent prompt and agent hooks with all fields - Pack authors can define prompt/agent hooks in
techpack.yaml - Validation ensures
promptis present for these types - Backward compatible
Reference
Reactions are currently unavailable