chore(codex): Add PreToolUse hook for graphify search context
Integrates a PreToolUse hook that provides context from the 'graphify' knowledge graph. When the AI is about to use search commands (e.g., `grep`, `find`, `ripgrep`), it will be prompted to consult `GRAPH_REPORT.md` if a graph exists, guiding it to leverage structured knowledge before searching raw files.
This commit is contained in:
parent
e381ae0ebf
commit
51e6057c34
15
.codex/hooks.json
Normal file
15
.codex/hooks.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"hooks": {
|
||||
"PreToolUse": [
|
||||
{
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "CMD=$(python3 -c \"import json,sys; d=json.load(sys.stdin); print(d.get('tool_input',d).get('command',''))\" 2>/dev/null || true); set -- $CMD; case \"$1\" in grep|egrep|fgrep|rg|ripgrep|find|fd|ack|ag) [ -f graphify-out/graph.json ] && echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files.\"}}' || true ;; esac"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user