Claude repeatedly ignores CLAUDE.md rules about information scope/context boundaries
Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Mar 29, 2026 · closed Mar 29, 2026
Problem
Claude Code repeatedly fails to respect rules written in CLAUDE.md about information scope boundaries, despite being corrected multiple times within the same conversation.
Example scenario
The user has multiple "universes" (contexts) for writing information:
- Backlog (team issue tracker) — shared with the team, should only contain team-relevant info
- Global CLAUDE.md — personal cross-project settings
- Project-level memory — project-specific personal notes
Despite having explicit rules in CLAUDE.md stating "do not mix information across scopes," Claude repeatedly:
- Wrote personal project info (port assignments from unrelated projects, SSH key locations) into team-shared Backlog tickets
- Wrote team-shared rules into project-local memory instead of global CLAUDE.md
- Used a port number (15432) already allocated to another project without checking the port assignment table that was right there in CLAUDE.md
- Had to be corrected 5+ times in a single conversation for the same category of mistake
What makes this hard to fix
- Adding rules to CLAUDE.md doesn't reliably prevent violations — Claude reads the rules but doesn't consistently apply them during task execution
- The user tried adding more specific rules, checklist-style rules, and bold/emphasized rules — none reliably prevented recurrence
- The pattern suggests Claude prioritizes "completing the task quickly" over "checking constraints before acting"
Expected behavior
When CLAUDE.md contains explicit scope rules (e.g., "do not write personal info to Backlog"), Claude should check these constraints before writing, not after being corrected.
Suggested improvement
A mechanism for Claude to enforce pre-action constraint checking — similar to how it checks file permissions before editing, it should check scope/context rules before writing to external systems (Backlog, GitHub, etc.).
Environment
- Claude Code CLI on WSL2
- Model: Claude Opus 4.6 (1M context)
5 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
CLAUDE.md rules about scope boundaries can be enforced mechanically with hooks:
Prevent writing personal info to team-shared files:
The hook runs at the process level — even when the model "forgets" the scope rule mid-conversation, the hook enforces it. No amount of attention drift can bypass a PreToolUse exit 2.
For the reverse direction (team rules going to personal memory), add a second check for team-specific patterns in personal file paths.
Closing as duplicate of #29121, #37961, #40425.
Closing as duplicate of #29121, #37961, #40425.
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.