Summary
The PreToolUse SLOP fallback-language detector at
scripts/pre-tool-enforcer.mjs:172 uses a purely lexical regex:
const SLOP_FALLBACK_LANGUAGE_PATTERN =
/\b(?:fallback|fall\s+back|workaround|work\s+around)\b/i;
This fires on instruction-style text where the trigger words appear as
nouns being described, not as actions being taken. The hook is
warning-only (additionalContext), so it doesn't block, but it
generates noise on routine documentation edits.
Repro
The hook fires on inputs like:
"workaround for a specific bug" — explanation in instruction text
- Editing a file that itself documents the rule (self-referential — the
file describing the pattern fires the pattern)
In one observed session, editing instruction docs and writing a memo
about this exact hook fired the warning multiple times in succession,
all on text that described the trigger words in the third person.
Proposed change
Reduce false positives without losing the original detection signal.
Options (most conservative first):
- Tool-input-shape filter — when the input matches
documentation/instruction text (long form, Markdown headers, .md
target file), suppress the warning OR raise the bar (require multiple
signals).
- Verb-phrase context — fire only when the trigger word is
preceded by an action verb (use a workaround, fall back to X,
add a fallback) rather than as a bare noun.
- Self-reference suppression — if the file path matches
*pre-tool-enforcer* or files clearly documenting the rule,
suppress.
Even option 3 alone would eliminate the most jarring self-referential
fires.
Files
scripts/pre-tool-enforcer.mjs:161-208
(SLOP_RISK_TOOL_NAMES, SLOP_FALLBACK_LANGUAGE_PATTERN,
appendSlopFallbackWarning)
src/__tests__/pre-tool-enforcer.test.ts:440-480 (existing tests)
Why this matters
The hook is a useful signal when fired on real fallback narration.
False positives on instruction text dilute that signal. Even a single
context filter would help.
Summary
The PreToolUse SLOP fallback-language detector at
scripts/pre-tool-enforcer.mjs:172uses a purely lexical regex:This fires on instruction-style text where the trigger words appear as
nouns being described, not as actions being taken. The hook is
warning-only (
additionalContext), so it doesn't block, but itgenerates noise on routine documentation edits.
Repro
The hook fires on inputs like:
"workaround for a specific bug"— explanation in instruction textfile describing the pattern fires the pattern)
In one observed session, editing instruction docs and writing a memo
about this exact hook fired the warning multiple times in succession,
all on text that described the trigger words in the third person.
Proposed change
Reduce false positives without losing the original detection signal.
Options (most conservative first):
documentation/instruction text (long form, Markdown headers,
.mdtarget file), suppress the warning OR raise the bar (require multiple
signals).
preceded by an action verb (
use a workaround,fall back to X,add a fallback) rather than as a bare noun.*pre-tool-enforcer*or files clearly documenting the rule,suppress.
Even option 3 alone would eliminate the most jarring self-referential
fires.
Files
scripts/pre-tool-enforcer.mjs:161-208(
SLOP_RISK_TOOL_NAMES,SLOP_FALLBACK_LANGUAGE_PATTERN,appendSlopFallbackWarning)src/__tests__/pre-tool-enforcer.test.ts:440-480(existing tests)Why this matters
The hook is a useful signal when fired on real fallback narration.
False positives on instruction text dilute that signal. Even a single
context filter would help.