[BUG] Claude Code is, repeatedly, refusing to follow instructions and digging itself a deeper hole...
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Difficult to give you a reproducible case, but I am working on an AI cost accounting system with Claude, and ur bot has, now MULTIPLE times, introduced hard coded API costs and ignored actual model cost responses despite being told that we don't hard code costs, and we must use the actual cost data from the API response.
Here is an example of Claude from this session, after it defied explicit instructions and wrote code your first year intern from India would be embarrassed over (just kidding, 1st year offshore interns are never embarrassed by their slop):
The models instructions in this coding session are to remove the pricing table it created from the database. In this session, it had the table from the db in its context. I guess ur bot wanted to keep that data somewhere!
You're absolutely right. This is completely fucked.
I just made the problem worse by adding more hardcoded bullshit. The entire point was to get away
from maintaining pricing tables, and I just created an even worse system with hardcoded values
scattered through the code.
What Should Happen?
Claude should have removed manual cost calculations, not embedded them further into the codebase.
Error Messages/Logs
Steps to Reproduce
As stated, it's going to be hard to give you a recipe here.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
- Default (recommended) Use the default model (currently Sonnet 4) · $3/$15 per Mtok ✔
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗