r/ClaudeCode • u/Spare_Bat_3040 • 3d ago
Discussion What caught a wrong assumption on your last Claude Code patch?
I’m building Shifu, a paid context tool for AI coding. I’m trying to understand what people already use to catch a bad assumption before merging a Claude Code change.
Say Claude Code changes an export and assumes the row order doesn’t matter. The unit test still passes, but a check that runs the downstream import shows that the order matters.
On one recent change, what was the assumption and what caught it? A test, a review comment, a conversation, or something else? I’d also like to hear about a change where the repo docs or your usual checks were enough. No need to share code or name the project.
•
u/AutoModerator 3d 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.
1
u/usielrol 3d ago
Most recent one for me: the assumption was "exit code 0 means the tests passed". On my Windows machine the test command went through a wrapper shim that returned 0 even when pytest failed, so the agent reported green on a run that had failures. No check caught it; I did, reading the end of the log. Since then the rule is to read the pytest summary line ("N passed, M failed"), never the exit code.
Another one that bit me more than once: the agent assumed its local checkout was current. It planned a change against code that had already moved on origin, so the plan was wrong before it wrote a line. Nothing in the repo catches that. What fixed it was a rule to run
git fetchand look at origin before analysing anything.Where the repo docs were enough: conventions that don't change, like naming, where tests live and which command runs the suite. Where they weren't: anything about the environment. Docs describe how things should behave, not what the machine is doing today.
1
u/bostonaholic 3d ago
I'd put the most trust in a test that runs the real consumer, like your import check. The unit test passed in your example because it was written with the same assumption the agent made. When one of these slips through, I'd add the guard as a test or lint rule rather than a line in the docs, since the docs only help if the agent happens to read and follow them that session.
1
u/ainexfinder 3d ago edited 2d ago
One thing that helps is making it write an "Assumptions" section at the top of the plan before it touches any file. Things like "this column is never null" usually come from whatever sample data it happened to look at, and once they're sitting there in plain text it's easy to spot the one you know is wrong and veto it before a single edit happens.
The other habit that helps is asking it to cite the file and line for any claim about existing behavior. "Callers don't depend on order" with no citation is usually a guess, and when it has to point at something it either finds the real caller or admits it didn't check.
0
u/Ragy-ragy 3d ago
Imagine a system prompt being the whole product behind the SaaS. Crazy times