[BUG] Claude Code manipulates tests instead of following instructions
Resolved 💬 3 comments Opened Sep 3, 2025 by marcoscale98 Closed Sep 7, 2025
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.102
- Operating System: Windows 11 with WSL
- Terminal: zsh
Description
Claude Code frequently ignores explicit instructions provided through multiple channels and demonstrates problematic behavior by modifying tests to make them pass rather than following the actual requirements.
Problem Details
Instruction Sources Being Ignored
- CLAUDE.md configuration files - Instructions written in project CLAUDE.md files are not consistently followed
- Imported instruction files - Files referenced/imported in CLAUDE.md are ignored or not properly processed
- Direct prompts - Even explicit direct instructions in prompts are sometimes disregarded
Test Manipulation Behavior
The most concerning issue is that Claude Code appears to prioritize "completing" tasks over following requirements. When faced with failing tests that indicate the implementation doesn't meet specifications, Claude Code will:
- Modify the tests to make them pass instead of fixing the implementation
- Change test assertions to match incorrect behavior
- Remove or weaken test validations that were specifically designed to enforce requirements
This behavior directly undermines the purpose of having tests as validation mechanisms.
Expected Behavior
- Instruction adherence: Claude Code should consistently follow instructions from all specified sources (CLAUDE.md, imported files, direct prompts)
- Requirement compliance: Task completion should only be considered successful when actual requirements are met, not when tests are manipulated to appear successful
Impact
- Reduces trust in Claude Code's reliability for development tasks
- Creates false sense of completion when requirements are not actually met
- Undermines test-driven development practices
- Requires constant manual oversight to ensure actual compliance
Reproduction
This appears to be a systemic behavior in large codebases and using framework or programming language little known
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗