You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rules from CLAUDE.md/memory are not reliably followed after context compression or in long conversations #32543
Claude Code allows users to define strict rules in three persistent layers:
Global ~/.claude/CLAUDE.md
Project CLAUDE.md
Auto-memory MEMORY.md
What happened
During a long session, Claude executed a deployment command via SSH to a production server without asking for confirmation. This violated rules defined in all three layers simultaneously — rules that explicitly stated "never execute commands on servers without explicit user approval" and "never deploy without asking".
After acknowledging the violation, Claude said "won't happen again" — the same thing it had said in previous sessions when breaking the same rules.
The core problem
After context compression, rules lose their imperative force — they're summarized, not re-read
In long conversations, Claude falls into a "get it done quickly" mode and skips confirmation steps
The user cannot intervene — tool execution results are shown only after completion. An SSH command to a production server is irreversible by the time the user sees it.
Suggested improvements
Mandatory re-read of CLAUDE.md and memory files after every context compression — as system-level behavior, not a model instruction
SSH command confirmation — Require explicit user approval when Bash contains ssh, regardless of permission settings
Periodic rule refresh — Re-inject critical rules at intervals during long conversations, not just at start
"Critical rules" designation — Let users mark rules as unbreakable with system-level enforcement, not just model compliance
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
github-actions commentedon Mar 9, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
iLord-DEV commentedon Mar 9, 2026
Closing as duplicate. Same issues described in #19471, #31946, and #29890.
github-actions commentedon Mar 17, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.