Session compaction summaries can override .claude/rules/ directives

Resolved 💬 5 comments Opened Feb 23, 2026 by nexusledge-lc Closed Apr 6, 2026

Problem

When a Claude Code session runs out of context and gets compacted/continued, the compaction summary can describe approaches that violate rules defined in .claude/rules/*.md and CLAUDE.md. The model then follows the summary's approach rather than re-validating against the loaded rules.

This defeats the purpose of persistent rules — they exist to be the highest-authority behavioral contract, but compaction narratives implicitly override them by describing "what was in progress" without checking compliance.

Reproduction

  1. Define a clear behavioral rule in .claude/rules/ (e.g., "when using Playwright, never use aws logs or browser_network_requests for verification — only use human-equivalent UI interactions")
  2. In a long session, start following the rule correctly
  3. Mid-session, deviate from the rule (e.g., check Lambda logs instead of using Playwright UI verification)
  4. Let the session hit context limits and compact
  5. Continue the session — the compaction summary says "was checking Lambda logs as verification"
  6. The model continues the violating approach because the summary reads like instructions to follow, rather than context to validate against rules

Expected Behavior

Rules in .claude/rules/ and CLAUDE.md should take priority over compaction summaries. When a session is continued:

  • The model should re-validate the prior approach against loaded rules before continuing
  • If the summary describes an approach that conflicts with a rule, the rule should win
  • Compaction should ideally flag or filter approaches that contradict loaded rules

Impact

  • Rules become suggestions rather than constraints across session boundaries
  • Users invest time authoring precise behavioral directives that get silently overridden
  • The longer and more complex the session, the more likely this occurs (exactly when rules matter most)

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6
  • Rules loaded via .claude/rules/*.md and CLAUDE.md

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗