Claude Tools / Hooks / Prompt Policy Check
Illustrative event-triggered script
Prompt Policy Check
Checks submitted prompts against project policy before the agent continues.
UserPromptSubmitTemplate signals
Status
Draft
Audit
Not run
Collection
Hooks
Anatomy
What it contains
- An event name and optional matcher
- A command, prompt, or HTTP action
- Timeout, dependency, and failure behavior
Lifecycle
How it works
- Claude Code emits a lifecycle event
- The matcher decides whether the hook applies
- The configured action runs automatically
- Its result allows, blocks, or annotates the event
Audit lens
What Bear Brown would check
- Automatic execution is visible and justified
- Shell input is quoted and validated
- Timeouts, dependencies, and failure modes are declared
Content preview
Configuration
Editable starter content12 lines
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash|Write",
"hooks": [{
"type": "command",
"command": "python3 scripts/check_secrets.py",
"timeout": 10
}]
}]
}
}Related