[Bug] Agent hooks fail with "Messages are required for agent hooks" when using prompt field
Bug Description
Bug: PreToolUse agent hooks fail with "Messages are required for agent hooks"
Configuring a hook with "type": "agent" and a "prompt" field (per the documented schema at docs.claude.com/en/docs/claude-code/hooks) fails at runtime with:
▎ Failed to run: Messages are required for agent hooks. This is a bug.
Repro — add to .claude/settings.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{
"type": "agent",
"if": "Bash(git commit*)",
"prompt": "Review the staged diff for issues.",
"timeout": 120
}]
}] …
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗