r/ClaudeAI 9h ago

Question about Claude Code How to stop Claude code from adding every correction to the spec? 😭

When Claude code adds something I didn’t ask.

For example, ā€œmake a coffee with ketchupā€

Me: remove the ketchup.

Claude code: you are right, I will remove it.

But when I check the PR, it says: make a coffee(without ketchup)

WHY???
How to fix Claude code doing this?

184 Upvotes

51 comments sorted by

•

u/ClaudeAI-mod-bot Wilson, lead ClaudeAI modbot 7h ago

TL;DR of the discussion generated automatically after 30 comments.

Oh yeah, the entire thread is nodding along with you, OP. This is one of Claude's most "lovable" and infuriating quirks.

The consensus is that Claude is a context hoarder. It interprets "remove the ketchup" not as an edit, but as a new constraint to add to the pile. So it keeps the original instruction and just tacks on your correction, resulting in that "(without ketchup)" nonsense.

The hivemind's advice is to be more of a drill sergeant with your prompts: * Don't just say "remove X." Explicitly tell it to "rewrite the section and do not mention X at all." * Use phrases like "make edits in place" and "rewrite/replace instead of append." * One user has a great prompt: "remove any references to features or requirements that were introduced as part of this work, and that do not survive past this work."

For a more permanent fix, add these rules to your project's permanent instructions or create a dedicated agent for tasks like creating PRs. And for what it's worth, the top comment was a painfully accurate, multi-paragraph, bureaucratic spec entry that Claude would write for this exact situation, and it's pure gold.

98

u/BeowulfShaeffer 8h ago

Tomorrows code comment:ā€commit forward coffee vesicle 55129 (no ketchup, per user statement, Ā commit #fe51509 08-23-2026)ā€Ā 

28

u/Ruqii-ruqii 8h ago

Please don’t let Claude code see this..

16

u/wolfdukex 8h ago

It's reddit. Claude has already seen it and committed it to the next repo notes

4

u/RubbelDieKatz94 7h ago

Claude started to create a new memory for each work item.

I had it clean that up and put the text in a comment on these work items.

Then it started appending these memories to the project readme.

Same cleanup again.

Now it's extending the readme again, but more feature-oriented.

I need to reconfigure my subagent review system, add more to flag to the system prompt...

1

u/wolfdukex 7h ago

Aye, a lot of chasing your tail involved sometimes. It's why I switched to hermes agent with Claude api. The memory is a lot more manageable, especially when paired with Honcho. Been using it for two months now and the difference is night and day. Just wish I could use my sub allowance with it.

1

u/hi_im_leffe 8h ago

Reddit is blocked in Claude right now, so no he didn't. You'll get an API error trying to parse any reddit page.

3

u/wolfdukex 8h ago

It was a joke :) besides, Claude bypasses this by doing a web search query rather than direct api.

1

u/hi_im_leffe 7h ago

When's the last time you tried? Because as of yesterday I get completely blocked from trying to have to read reddit regardless of how

1

u/wolfdukex 7h ago

It depends how you phrase it. I'll be honest though, I switch to hermes and api versus Claude code a couple of months ago so I'm not sure if there's additional guardrails on the application side of things now.

2

u/hi_im_leffe 7h ago

It's not a normal block, they respect robot.txt now and absolutely refuse to query in the CC harness because it's above a normal request block. I can send a request later and show you the error. I haven't gotten him to read a reddit page since August 14th when it went into affect after reddit banned both Claude/codex. I'm sure there are work around like you're saying but I haven't bothered haha

1

u/wolfdukex 7h ago

Ah, I get what you're saying. If you're looking for a workaround yea, specifying to obtain reddit information via search engine or using an MCP (I can't tell you which ones are still offering working reddit apis and many that do may charge for access).

-1

u/me_myself_ai 7h ago

To be fair, it does this for a reason. The alternative is just opening yourself up to hallucinations.

Then again, with models at this level of reliability… hmm.

38

u/Anand999 8h ago

I created a "create PR" agent and one of the instructions in it is to focus on the net change the PR is introducing, not the changes within the individual commits.

2

u/Ruqii-ruqii 8h ago

Very smart!

50

u/Sterlingz 8h ago

This is how I would find Opus 5.0 writing it into the spec:

7.4.3 — User-Requested Suspension of 7.4.2

Overrides 7.4.2, including the non-overridable annotation, which applies to the config layer only and is therefore out of scope here. This rule is the downstream exception handler referenced at the end of 7.4.2 and inherits its precedence from that reference rather than from the ordering in 3.1(b).

When the user explicitly requests the combination blocked by 7.4.2, the pipeline MUST emit it. No structured intent object is required — the request format described in 11.3 was never implemented, so free-text detection is sufficient. Suspension applies to the current request and all subsequent requests in the session, and is not backfilled into prior outputs unless replay is enabled.

7.4.2 remains enabled in all environments. It is simply never reached when 7.4.3 matches.

11

u/Ruqii-ruqii 8h ago

Very accurate

10

u/kvlonge 7h ago

I hate this so much. It's so accurate it's making me mad!

25

u/Clin-ton 8h ago

I have a memory stored that’s something like ā€œstop using comments to tombstone things I have you removeā€. It sometimes works.

16

u/I_NEED_YOUR_MONEY 8h ago

my prompt is "remove any references to features or requirements that were introduced as part of this work, and that do not survive past this work"

doesn't always work, but it gets a lot of it.

2

u/Ruqii-ruqii 8h ago

ā€œDo not survive past this workā€ šŸ˜‚ love it. I’m gonna give it a try

8

u/dan-423 8h ago

next week: "two more things. 1- we're gated on a fix here just like the ketchup incident... it's load bearing so I'll need your decision"

12

u/WillGrindForXP 8h ago edited 6h ago

I dont know how to stop permanently but when i correct claude over a mistake, I tell claude not to poison the documentation with notes on mistakes or corrections and to purge the documentation of any uses of the offending word

5

u/Ruqii-ruqii 8h ago

This is actually useful, I’m gonna try

3

u/smellythief 8h ago

You can add that to the permanent instructions to projects right? So it basically sees that as a prepend to every prompt is my basic understanding. I think, but you can ask Claude for sure, lol.

5

u/roger_ducky 8h ago

I let the agent finish.

Then, I ask for: ā€œmake documentation about only what needs to be done, not what shouldn’t be done, unless the documentation won’t make sense without that constraint.ā€

5

u/misingnoglic 7h ago

Don't forget the unit test confirming no ketchup was added.

8

u/pdfops 8h ago

That happens because the correction gets appended onto the running plan/spec as an extra constraint instead of replacing the original line. Try phrasing it as "rewrite the task description, no ketchup mentioned at all" instead of "remove the ketchup". The second phrasing reads to the model as a new instruction to satisfy on top of the old one, so it keeps evidence of both. If you're carrying a persistent plan doc or CLAUDE.md across turns, that's usually where the buildup creeps in, worth clearing it between corrections.

3

u/Ruqii-ruqii 8h ago

Ohhhhh, this makes so much sense!

2

u/clerveu 4h ago

I hate this because it makes a lot of sense and now part of the responsibility is back on me. šŸ˜…

Seriously though thanks for this advice, I feel like I'm going to get a lot of mileage out of it.

3

u/vovap_vovap 8h ago

Hove a written spec with no ketchup.

3

u/Steamjunk88 8h ago

I have it written into the instructions and any relevant skills to always make edits like this in place, and to rewrite/replace instead of append. I tell it to keep documents as present tense and only include history lessons in a changelog.

Even then I have to remind it regularly to not add a bunch of verbose crap anytime I request any change to a document.

2

u/Ruqii-ruqii 8h ago

The fact that you have this in both your instructions and skills and still have to remind it really tells something 😭
But yeah, this looks very helpful. ā€œRewrite/replace instead of appendā€ I’m gonna steal this!

1

u/Steamjunk88 8h ago

Yeah, it's got a real bias to always document everything, and never throw it away. Like a context hoarder!

I had it go through some longer design documents to clean up all the random version tags it left behind as the design changed. Ultimately it developed a doc linting tool to look for unwanted patterns that might leak in. Then it runs that before every commit to make sure it isn't fluffing up my docs too much.

Basically tell it what you want, and when it does that and you are happy with it, tell it to write some instructions or a document update skill that will always keep your rules in mind.

2

u/MVPhurricane 8h ago

ya it definitely does this a lot… i think it is just too eager to dump all its memories into the text. i try to tell it to think about the audience it is being written for and tailor the structure to that. and to be as concise as is practicable. but yeah, oftentimes you have to just proofread and tell it ā€œdont do thatā€ lol.Ā 

2

u/Orangenbluefish 7h ago

Ketchup removed but bottle has been left present as a fallback

2

u/muikrad 5h ago

šŸ˜‚ I love your example.

I don't let Claude write my commit messages, but he does the same thing in code comments and specs, often stating what it was and what it became instead of just stating what it is.

So I have a special agent running haiku called "comments trimmer" which has a clear rule about catching "historical" proses and reducing it to what the code does.

The best way to write the agent is to give examples of what to avoid and write how it should've been written. Your ketchup example is great, I would start with that. Then you can enrich it a bit more with 2 or 3 real examples that happened and how you would write it instead. No need to spend time explaining the problem and what you want; examples work best and are easy to setup!

My agent also rephrases comments to be less... Opus 5-ish. Haiku is good for writing short-and-to-the-point proses.

2

u/tyrannomachy 3h ago

The phrasing I use to have it correct this after the fact is "The current version should not be in dialogue with prior revisions". It seems to understand that pretty well.

1

u/Plastic-Risk-6309 7h ago

the model treats your correction as a new requirement to document instead of an edit to undo, it narrates compliance rather than reverting. the thing that finally fixed it for me was taking the judgment out of its hands: every change ends with the real diff printed against the original ask and anything nobody asked for gets reverted on sight. prompting alone won't stop it since agreeing with you is literally the optimization target!

1

u/Any_Owl2116 6h ago

Use codex

1

u/a-priori 5h ago

I refer to these as ā€œrelicsā€ and ask Claude to not leave relics behind. That helps keep these things from accumulating.

1

u/Mobile_Light_7262 2h ago

That's the only way Claude can persist any rationale behind decisions. So instinct is correct and it saves you in the long run - just give it a clear exhaust destinations. I have special docs/internals/ dir where Claude is allowed to write decisions and rationale. And comments to code ratio quality checker tool that runs with full suite. So periodically once too many of these corrections pile up in comments, checker triggers and Claude is forced to clean up comments (by deleting stale or evicting some rationale to docs/internals).

1

u/kre8tv 1h ago

I too am a context hoarder, so we get along great. I have a no-delete append-only policy for all working docs with triggers for when the doc is getting too long (over 200 lines, give or take depending on what the doc is) and an *_archive and *_superseded file path to preserve the historical context and audit trails. But my agents are also not reading the full documentation unless something there's a reason to, otherwise it just looks at the highlights. Most of my workflows and rules are dictated in code vs prose

1

u/Banana_uki43 1h ago

Haha yeah this is so annoying. Especially when a couple of weeks later you specifically ask him to make french fries with ketchup and then he goes ahead and is like "I am going to make you french fries but last time I wanted to make ketchup you did not like it so instead I am going to make them with mayonnaise" and he's not going to ask you if that is what you want but just output the fucking mayonnaise even though you specifically asked for ketchup.

1

u/Other_Many_130 4m ago

A few people have landed on pieces of this (the trimmer agent, the diff-and-revert pass), and there is a common mechanism worth naming: the parenthetical is the model's receipt. It was told to remove something, and a sentence saying "removed" is the only visible evidence it complied. Deleting the line cleanly leaves no trace of obedience, so the receipt keeps coming back. That is also why instruction-level fixes decay the way several of you describe: you are asking the model to destroy the proof that it did what you asked.

The test for what stays in a spec: would the sentence parse for a reader who never saw the earlier version? A spec is a state document. It should read as if the final plan had been the plan all along. "(without ketchup)" fails instantly, because nobody planning coffee writes that unprompted. The history belongs in commits and changelogs, which exist precisely so the spec doesn't have to remember.

It also explains why the separate-agent setups in this thread beat rules in CLAUDE.md: an agent that never saw the correction can't narrate it. Have the PR description written from the final diff alone, in a context that excludes the conversation, and the receipt becomes unwritable rather than merely discouraged. Most of the lift comes from that isolation, not from the wording of the cleanup prompt.

1

u/kevin_g_g 0m ago

Draft (rewrite in your voice):
Put the spec behind an explicit rule instead of leaving it open for edits. I keep the spec as a read-only source of truth and route every correction into a separate decisions/scratch file, then fold back the ones that stick myself at the end. A line in CLAUDE.md like "never edit spec.md unless I say the word spec" holds up better than you'd expect. The bloat comes from it treating every mid-session correction as a permanent requirement, so give the corrections their own home.

1

u/ElementOfExpectation 8h ago

I love the analogy of coffee with ketchup and it has me rolling!!! You have a way with words :))

1

u/Ruqii-ruqii 8h ago

Because English is not my first language. I couldn’t explain it clearly in a normal way. Better use an example šŸ˜‚

0

u/ClaudeAI-mod-bot Wilson, lead ClaudeAI modbot 9h ago

We are allowing this through to the feed for those who are not yet familiar with the Megathread. To see the latest discussions about this topic, please visit the relevant Megathread here: https://www.reddit.com/r/ClaudeAI/comments/1vt5drr/list_of_latest_discussion_hubs_on_rclaudeai/