1.6 KiB
1.6 KiB
@local/omp-hooks
Project-level and session-level lifecycle hooks for DeepSeek Harness (DSH), with full compatibility for Claude Code .claude/settings.json, .claude/hooks.json, and project-root hooks.json.
Supported Hook Events
| Event | Firing Moment | Capabilities |
|---|---|---|
SessionStart |
On agent creation / session init | Injects context before the first turn |
UserPromptSubmit |
When user prompt / messages are submitted | Can block prompt (exit 2) or attach extra context |
PreToolUse |
Before any tool executes | Can block execution (deny), ask confirmation (ask), or pass |
PostToolUse |
After a tool finishes execution | Can block result with feedback, or append context |
Stop |
When agent turn is stopping | Can steer agent into continuing with a reason |
Configuration Locations (per-project discovery)
In any project workspace directory, hooks are automatically discovered from:
.claude/settings.local.json.claude/settings.json.claude/hooks.jsonhooks.json
Example .claude/settings.json
{
"hooks": {
"PreToolUse": [
{
"matcher": "bash|write",
"hooks": [
{
"type": "command",
"command": "python3 $CLAUDE_PROJECT_DIR/.claude/hooks/guard.py",
"timeout": 10
}
]
}
],
"PostToolUse": [
{
"matcher": "edit|write",
"hooks": [
{
"type": "command",
"command": "npx prettier --write $CLAUDE_PROJECT_DIR/src"
}
]
}
]
}
}