chore: add project planning-with-files hooks
This commit is contained in:
14
.codex/hooks/pre-tool-use.sh
Normal file
14
.codex/hooks/pre-tool-use.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# planning-with-files: Pre-tool-use hook for Codex
|
||||
|
||||
HOOK_DIR="$(cd "$(dirname "$0")" 2>/dev/null && pwd)"
|
||||
PLAN_DIR="$(sh "${HOOK_DIR}/resolve-plan-dir.sh" 2>/dev/null)"
|
||||
PLAN_FILE="${PLAN_DIR:+${PLAN_DIR}/}task_plan.md"
|
||||
|
||||
if [ -f "$PLAN_FILE" ]; then
|
||||
# Log plan context to stderr so the Codex adapter can surface it as systemMessage.
|
||||
head -30 "$PLAN_FILE" >&2
|
||||
fi
|
||||
|
||||
echo '{"decision": "allow"}'
|
||||
exit 0
|
||||
Reference in New Issue
Block a user