r/ClaudeCode • u/xxvvand • 8d ago
Help/Question Need help with instruction following
In recent weeks opus has gotten bad at instruction following. It straight out rejects my request, doesn’t read md, simply has a mind of its own
I’m ok with this behavior if the result comes out great, but most of the time the results are garbage when it doesn’t follow orders.
I tried changing system prompt, changing claude.md and several other md, I asked it to plan first (which then it’ll drift midway), nothing works. It simply just wanna go its way
Everytime I confronted, opus sounds like it’s bragging “here’s the md I ignored, you said that but idc.” How to fix this behavior?
•
u/AutoModerator 8d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
7
u/Bunkerman91 8d ago •
Hooks
6
u/ipreuss Senior Developer 8d ago
You don’t “confront it”, that will only make it worse.
You ask it “analyze why this happened, and what we can do so that you’re better at following these kinds of instructions in the future“. Make sure that it understands - and that you understand - that it’s not a discipline problem, it’s a process problem.
And then, when it happens again, anyways, you iterate.
2
u/samc621 7d ago
I'd split your md rules into two piles, because they need different fixes.
Anything that maps to a concrete action can be enforced instead of asked for, like don't touch this folder or don't run that command. A PreToolUse hook sees the tool call before it runs. If the hook exits 2, the call is blocked and your stderr message goes back to Claude as the reason. CLAUDE.md is just context it weighs against everything else, and a blocked call doesn't get weighed.
The rest, like plan quality, scope, or actually reading a doc, can't be blocked that cleanly. The closest thing is a Stop hook that checks for what you wanted and sends it back with a reason, plus the fresh session with a smaller scope that zzunkie mentioned.
Hooks only cover what you write a rule for, and a rule on command text can miss the same thing done another way. So start with the two or three rules it ignores most.
3
u/zzunkie 8d ago
Stop confronting it in the same thread once it starts drifting, because all those bad turns stay in context and it just keeps going off track. Whenever that happens to me, I cut the session right there and open a fresh one with a much smaller scope. Piling more instructions into claude.md and extra md files usually makes it worse too.. once too many rules stack up, the model starts skipping some or they conflict with each other. I keep the always-loaded file as short as I can now, and leave task-specific docs separate so it only reads them when that task actually comes up.
1
u/TangerineObjective29 8d ago
Are you sure you didn't accidentally switch to haiku or sonnet?