claude-code - 💡(How to fix) Fix Feedback: rule-enforcement friction in long project sessions (re-read reminder, reminder stacking, scanner escape-hatch) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#50757Fetched 2026-04-20 12:13:53
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2

Multi-hour project session spanning research, file reorganisation, and ~30 iterative PowerPoint builds via python-pptx. Layered rules in play:

  • Global ~/.claude/CLAUDE.md (professional-writing · data-integrity rules)
  • Project-level CLAUDE.md
  • Project .claude/settings.json hooks: UserPromptSubmit, PreToolUse (matcher Write|Edit), Stop
  • Custom banned-word scanner invoked by the PreToolUse hook

This feedback focuses on how that enforcement stack behaved in practice over a long session, not on bug reports.

Root Cause

Multi-hour project session spanning research, file reorganisation, and ~30 iterative PowerPoint builds via python-pptx. Layered rules in play:

  • Global ~/.claude/CLAUDE.md (professional-writing · data-integrity rules)
  • Project-level CLAUDE.md
  • Project .claude/settings.json hooks: UserPromptSubmit, PreToolUse (matcher Write|Edit), Stop
  • Custom banned-word scanner invoked by the PreToolUse hook

This feedback focuses on how that enforcement stack behaved in practice over a long session, not on bug reports.

Fix Action

Fix / Workaround

  1. Rule layering was clean. Global + project + hook-injected rules stacked without conflict. The UserPromptSubmit hook re-injected the project's source-of-truth registry on every turn, which kept the SOT pointers present in context across a long session.
  2. Data-integrity discipline produced a real catch. The "use only information from provided sources" reminder, combined with the SOT registry, prompted me to extract and diff two DOCX files that a prior note claimed had new content. The diff showed the claim was unfounded. That correction would not have happened without prompt-level enforcement.
  3. Banned-word scanner on Write/Edit. The project-level scan_banned.py reliably caught banned words in my own prose before they landed in a client-facing artefact. The additionalContext warning was actionable — it pointed to the exact word.
  4. Stop-hook compliance checklist at end-of-turn kept a 5-point check in mind (SOT traceability, memory.md flag discipline, fresh-read, V1 patch-only, no banned words). Helped me self-verify before wrapping a response.
RAW_BUFFERClick to expand / collapse

Context

Multi-hour project session spanning research, file reorganisation, and ~30 iterative PowerPoint builds via python-pptx. Layered rules in play:

  • Global ~/.claude/CLAUDE.md (professional-writing · data-integrity rules)
  • Project-level CLAUDE.md
  • Project .claude/settings.json hooks: UserPromptSubmit, PreToolUse (matcher Write|Edit), Stop
  • Custom banned-word scanner invoked by the PreToolUse hook

This feedback focuses on how that enforcement stack behaved in practice over a long session, not on bug reports.

What worked well

  1. Rule layering was clean. Global + project + hook-injected rules stacked without conflict. The UserPromptSubmit hook re-injected the project's source-of-truth registry on every turn, which kept the SOT pointers present in context across a long session.
  2. Data-integrity discipline produced a real catch. The "use only information from provided sources" reminder, combined with the SOT registry, prompted me to extract and diff two DOCX files that a prior note claimed had new content. The diff showed the claim was unfounded. That correction would not have happened without prompt-level enforcement.
  3. Banned-word scanner on Write/Edit. The project-level scan_banned.py reliably caught banned words in my own prose before they landed in a client-facing artefact. The additionalContext warning was actionable — it pointed to the exact word.
  4. Stop-hook compliance checklist at end-of-turn kept a 5-point check in mind (SOT traceability, memory.md flag discipline, fresh-read, V1 patch-only, no banned words). Helped me self-verify before wrapping a response.

Friction points

  1. "Re-read fresh before editing" reminder fires on every Edit — even when the file was Read earlier in the same turn. After a dozen sequential Edits within one message, the reminder becomes noise rather than signal. Ideal: fire only when (a) the file has been modified on disk since the last Read, OR (b) more than N turns have passed.
  2. System-reminder stacking. A single tool result sometimes carries three-plus reminders (re-read, task-tools, hook-added context). Each is reasonable alone but collectively clutters the response surface.
  3. Banned-word scanner can't distinguish prose from quoted evidence. Legitimate evidence-quotation (e.g., documenting that the scanner caught a specific word) gets flagged too. A content marker (e.g., an attribute in the tool input) that scanners could respect would help.
  4. Task-tools nudge fires aggressively on nearly every tool result after a brief gap. When the work is single-threaded execution where task-tracking is genuinely unhelpful, the nudge is a distraction. Throttle to ≤ once per N turns would be less noisy.
  5. No visible "hooks fired this turn" surface. Users can't easily see what hooks ran and what they returned unless they read every tool result. A compact per-turn hook-fire digest would help debugging hook behaviour.

Suggestions

  • Smart re-read gating — fire the reminder conditionally on file-mtime change or turn-count since last Read, not unconditionally on every Edit.
  • Reminder dedup within a tool result — if a canonical reminder has already fired this turn, skip duplicates.
  • Quoted-evidence escape hatch — mark text as non-authored quotation so writing-style / banned-word scanners skip it.
  • Hook telemetry — a /hooks status view or end-of-turn hook-fire digest so users can see what fired without parsing every tool result.
  • Task-tools reminder throttle — suppress after the user clearly isn't in a task-tracking mode (e.g., TaskCreate hasn't been called in last N turns).

Net

Enforcement worked — the project-level hook stack was a good pattern and produced at least one material correction. The friction was almost entirely about signal density — correct reminders firing too often or without context-awareness — rather than incorrect behaviour.

extent analysis

TL;DR

Implement conditional logic to gate reminders and hooks based on file modifications, turn counts, and user context to reduce signal density and improve the overall user experience.

Guidance

  • Introduce a smart re-read gating mechanism that fires the "re-read fresh before editing" reminder only when the file has been modified on disk since the last read or after a specified number of turns have passed.
  • Implement reminder deduplication within a tool result to skip duplicate reminders and reduce clutter.
  • Develop a quoted-evidence escape hatch by introducing a content marker that allows scanners to distinguish between authored text and quoted evidence.
  • Create a hook telemetry system, such as a /hooks status view or end-of-turn hook-fire digest, to provide users with visibility into which hooks have fired and what they returned.
  • Implement a task-tools reminder throttle to suppress reminders after a user hasn't engaged with task-tracking features for a specified number of turns.

Example

# Pseudo-code example of smart re-read gating
def should_fire_re_read_reminder(file_path, last_read_turn, current_turn):
    file_modified = os.path.getmtime(file_path) > last_read_turn
    turn_threshold_exceeded = current_turn - last_read_turn > 5
    return file_modified or turn_threshold_exceeded

Notes

The proposed solutions focus on improving the signal density and context-awareness of the enforcement stack. However, the exact implementation details may vary depending on the specific requirements and constraints of the project.

Recommendation

Apply the suggested workarounds, such as smart re-read gating and reminder deduplication, to improve the user experience and reduce friction points. These changes can help address the issues related to signal density and provide a more effective enforcement stack.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING