.claude/settings.json hooks work as-is.
Quick example
Auto-format every TypeScript file the agent edits:.soulforge/config.json
/hooks inside SoulForge lists active hooks and toggles them per session.
Events
| Event | Fires | Matches |
|---|---|---|
PreToolUse | Before a tool runs | Tool name |
PostToolUse | After a tool succeeds | Tool name |
PostToolUseFailure | After a tool fails | Tool name |
UserPromptSubmit | On user message | — |
Stop / StopFailure | Turn ends | — |
SessionStart / SessionEnd | Session boundary | — |
PreCompact / PostCompact | Around compaction | — |
SubagentStart / SubagentStop | Spark/ember spawn/exit | — |
Notification | System notifications | — |
Rule schema
if field narrows by first string arg: Bash(rm *), Edit(*.ts), etc. * matches any sequence, ? one char.
Tool names use Claude Code conventions (Bash, Edit, Write, Read, Grep, Glob, WebSearch, Agent). SoulForge maps its internal names automatically.
Config sources (merged in order)
~/.claude/settings.json.claude/settings.json.claude/settings.local.json~/.soulforge/config.json.soulforge/config.json
"disableAllHooks": true in any file to kill all hooks.
Recipes
Block `rm -rf`
Block `rm -rf`
PreToolUse. Exit code 2 denies the call.Log every tool call
Log every tool call
PreToolUse. No matcher = all tools.Notify when done (macOS)
Notify when done (macOS)
Stop.Protocol
Hooks read JSON from stdin, optionally write JSON to stdout. Exit code0 = success, 2 = block, anything else = log warning.
stdin
PreToolUse can deny, modify input, inject context)
PostToolUse can inject additionalContext — no deny.
Safety
- Hooks die on
Ctrl+Xalong with the agent. - Default timeout 10s — hooks should be fast.
- Non-blocking errors (non-zero exit ≠ 2) log a warning, don’t stop the agent.

