Files
Mickael B. 2a3ba53b5c feat(omp): session-start and post-edit index hooks (#281)
Oh My Pi does not run Claude hooks/hooks.json. Ship a TypeScript
extension (package.json#omp.extensions) that reindexes on session_start
and after edit tool results, and add the matching PostToolUse hook for
Grok/Claude. Fail-open if ccc or .cocoindex_code is missing.
2026-08-29 17:58:20 -07:00

28 lines
947 B
JSON

{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"timeout": 60,
"command": "root=\"${CLAUDE_PROJECT_DIR:-${GROK_WORKSPACE_ROOT:-}}\"; [ -z \"$root\" ] && root=\"$(git rev-parse --show-toplevel 2>/dev/null || pwd)\"; command -v ccc >/dev/null && test -d \"$root/.cocoindex_code\" && (cd \"$root\" && ccc index) 2>/dev/null || true"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit|search_replace",
"hooks": [
{
"type": "command",
"timeout": 30,
"command": "root=\"${CLAUDE_PROJECT_DIR:-${GROK_WORKSPACE_ROOT:-}}\"; [ -z \"$root\" ] && root=\"$(git rev-parse --show-toplevel 2>/dev/null || pwd)\"; command -v ccc >/dev/null && test -d \"$root/.cocoindex_code\" && (cd \"$root\" && ccc index) 2>/dev/null || true"
}
]
}
]
}
}