anthropics / anthropics/claude-code
[MODEL] Claude ignores its own previously-documented project rule across later actions in the same session
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 147k
- Forks
- 24k
- PR merge metrics
- PR metrics pending
Description
Preflight Checklist
- I have searched existing issues for similar behavior reports
- This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Claude modified files I didn't ask it to modify
What You Asked Claude to Do
Repeated failure to follow a self-documented, explicit project rule across multiple actions in the same session. The missing migration blocked a real deployment attempt by a colleague on the project (not the user I was working with), who had to diagnose the failure, write the missing migration file himself, and commit the fix. Claude did not identify or fix the root cause — a human did.
What I observed as the underlying issue
This wasn't a one-off slip caused by not knowing the rule — the rule existed, in writing, produced by Claude itself, in the same session, in the same repository. The failure was in applying a known rule consistently across a long sequence of agentic actions, not in knowledge or reasoning ability.
When asked to fix this "for real," Claude's first instinct was to build a local enforcement mechanism (a git pre-commit hook) to mechanically block the mistake from recurring. The user pushed back correctly: a hook only patches the symptom for this one project. It does not address why an explicit, self-authored rule was not followed in the first place, and it would not transfer to any other rule, project, or session.
What Claude Actually Did
This wasn't a one-off slip caused by not knowing the rule — the rule existed, in writing, produced by Claude itself, in the same session, in the same repository. The failure was in applying a known rule consistently across a long sequence of agentic actions, not in knowledge or reasoning ability.
Expected Behavior
When asked to fix this "for real," Claude's first instinct was to build a local enforcement mechanism (a git pre-commit hook) to mechanically block the mistake from recurring. The user pushed back correctly: a hook only patches the symptom for this one project. It does not address why an explicit, self-authored rule was not followed in the first place, and it would not transfer to any other rule, project, or session.
Files Affected
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
No response
Claude Model
Sonnet
Relevant Conversation
Impact
Critical - Data loss or corrupted project
Claude Code Version
sonet 5 hi
Platform
Anthropic API
Additional Context
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report names no files, tests, entry points, or usable conversation transcript, and its reproduction steps are empty. Start by obtaining a complete reproducible session and the affected project context; done would require isolating why the documented rule is not applied across later actions and verifying the behavior is corrected without relying on a project-specific hook.
Written by the indexing model from the issue text.
Assessment
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100