feat(hooks): allow projects to opt out of require-plan-file check
Add a sentinel-file escape hatch: if `.claude/skip-plan-file-check` exists in the project's cwd, the ExitPlanMode hook exits 0 without demanding a local *-PLAN.md file. Needed by projects (e.g. agent-runtimes) that manage plans via an external system (work-items CP) rather than local repo files.
This commit is contained in:
@@ -10,6 +10,12 @@ if [ -z "$CWD" ]; then
|
|||||||
exit 0 # Can't determine cwd, allow through
|
exit 0 # Can't determine cwd, allow through
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Projects can opt out by placing .claude/skip-plan-file-check in their root.
|
||||||
|
# Used when the project manages plans via an external system (e.g. a work-items CP).
|
||||||
|
if [ -f "$CWD/.claude/skip-plan-file-check" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if ls "$CWD"/*-PLAN.md 2>/dev/null | grep -q .; then
|
if ls "$CWD"/*-PLAN.md 2>/dev/null | grep -q .; then
|
||||||
exit 0 # Plan file exists, allow exit
|
exit 0 # Plan file exists, allow exit
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user