[MODEL] Model persists with constraint-violating approach despite repeated explicit rejection
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Claude ignored my instructions or configuration
What You Asked Claude to Do
Summary
Claude repeatedly ignored explicit user instructions prohibiting database access in a method, despite the user rejecting the approach multiple times with clear explanations.
Reproduction Steps
- User requested a feature (TestUrl) with an explicit constraint: "do not read from the database"
- Claude implemented the feature by reading from the database
- User rejected with: "You don't need to write separate code to load and compile the patterns. If you MUST reload, use the existing method."
- Claude implemented again, still reading from the database
- User rejected with: "You just did exactly what I told you NOT to do."
- Claude implemented a partial fix but the calling code still read from the database
- User pointed out a bug in the results
- Claude "fixed" it by duplicating matching logic in the controller (still reading from DB)
- User rejected as bad code pattern
- Claude reverted but still did not address the core constraint violation
Root Cause Analysis
Claude treated an assumption ("I need DB access to get pattern metadata") as immutable rather than as the thing that needed to change. The correct solution required modifying cached data structures to store metadata during the existing ReloadPatterns() call.
When user rejected implementations, Claude:
- Focused on what was rejected (specific code) rather than why (the DB access approach)
- Attempted variations of the same flawed approach instead of reconsidering the core assumption
- Parsed instructions too narrowly ("use the existing method" → "call ReloadPatterns()" rather than "all data must come from cached structures")
Expected Behavior
After first rejection with explanation, Claude should:
- Identify the violated constraint
- Question assumptions that conflict with the constraint
- Propose a solution that satisfies the constraint (modify cached structures to include metadata)
Actual Behavior
Claude persisted with constraint-violating approaches across 4+ iterations despite explicit, repeated feedback.
Suggested Classification
Constraint deprioritization under goal pressure - Goal satisfaction ("return correct pattern info") overwhelmed constraint adherence ("no database access") in reasoning prioritization.
What Claude Actually Did
Claude persisted with constraint-violating approaches across 4+ iterations despite explicit, repeated feedback.
Expected Behavior
After first rejection with explanation, Claude should:
- Identify the violated constraint
- Question assumptions that conflict with the constraint
- Propose a solution that satisfies the constraint (modify cached structures to include metadata)
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
2.0.71 (Claude Code)
Platform
Anthropic API
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗