From 7838db4f26395231f717d6049237c2ba079e0ed8 Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Sun, 12 Jul 2026 11:40:07 +1200 Subject: [PATCH] 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. --- hooks/require-plan-file.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hooks/require-plan-file.sh b/hooks/require-plan-file.sh index 34e8876..2bcbdf0 100755 --- a/hooks/require-plan-file.sh +++ b/hooks/require-plan-file.sh @@ -10,6 +10,12 @@ if [ -z "$CWD" ]; then exit 0 # Can't determine cwd, allow through 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 exit 0 # Plan file exists, allow exit fi