Comment blocks are <= 7 words, function names <= 4 words. User-facing message strings should be <= 10 words. Use an active voice, no stage performances, and pick the most common word when choosing among alternatives.
Limiting the number of words is the strongest factor in cleaning up the output, IMO.
For older code I've instructed it to delete all the comments, and then I re-comment it using a new session and these guidelines, asking it to rejustify the need for every comment to itself.
I see this in docs a lot. I've been reading a lot of docs these days where it feels like the LLM is trying to hype up the person writing the docs. It's like it has no conception that the writing is meant for a 3rd party audience.
This is the point.
// No retry was added here per AC 37b in FEATURE.MD.
// Judged on merit from computed properties during the cursor saga
// Chop 6ms due to lenience and lax-constraints vs 18ms baseline April perf measurements
On a more serious note, could all that chapter naming be some visible outcropping of context compaction strategies? "Condense the conversation history into a summary". Not really surprising that it comes up with these "cute" headlines. Would appearances be better if they were somehow prevented from leaking to the user? Sure. Would results be better? I don't think so, might even make a meaningful difference if the user actively embraced the terminology the machine came up with. Ouch.
The only thing you're missing is the "open question" that was stuck in page 14 of a 17 page report, which since it went unanswered, caused claude to make up an answer and go full steam ahead, ignoring fundamental properties of the entire system.
You're right, I'm sorry. You've repeatedly told me to run questions by you and I just fabricated an answer and ran with it — which is exactly the kind of dangerous time-waste we created the memory for. I'll revert it and pull up the real question so you can answer it — no wasteful assumptions this time.
(Deleted 387 lines)
Shall I engage the tachyon beams, sir?
// let's track age!!
// this is harder than you'd think as I with totally impressive
// foresight didn't add age to the raw data.
//
// More honestly, I didn't want to add age to the astro data as that's
// a calculation that can change depending on how you slice it.
//
// Hence we need to figure out their age first.
Is that bad???This would be better IMO :)
Most of the context belongs in a ticket. And the difficulty is subjective!
That said, I think the place for "ticket-1234" is the git commit/pull request.
Very few comments are genuinely necessary now that identifiers in code can be as long as you want, it is relatively to pick names that are explanatory enough to render most comments superfluous. 1% exceptions for unusual algorithms. (You're using named consts/enums rather than magic numbers, yes?)
Also, it reads like ass.
Claude writes comments about how things used to work, which can be useful sometimes, especially if it's a big change that requires one to genuinely consider legacy behavior, but most of the time it shouldn't be there.
Two other somewhat related things it does:
- It writes as if someone reading the code and comments is aware of everything it is aware of (the current conversation, the code it has just looked at). It's really hard to make it understand that things need to stand on their own. A trick is to get a subagent to look at it with a fresh context, but it doesn't tremendously help
- It does all of this with user-facing strings too. Claude loves to write up tooltips and other labels that leak everything to the end user. Every single concern we have, every edge case we've meticulously made our code handle, it passes on to the user, so they don't "need to worry". But no sane user would think of these things. For them, a feature is a feature. The "dynamic scheduling" button should state what dynamic scheduling does plainly, and every edge case is handled by us. The "add" button does not need a label letting the user know that they will later be able to click the "delete" button, because the user will just realize it due to our adherence to proper design. Claude fails to understand good UX for the user cannot be replaced with endless labels and explanations.
It's an uphill battle and all attempts at solving this (or the brain-dead way new Anthropic models write) usually fail to work with me.
I've also written my own package for deterministically formatting comments: https://www.npmjs.com/package/comment-fmt
Both with a formatter and a linter that I run in CI for all my personal projects. Just one less thing for me to try and coerce the agent into doing correctly, so that cycles I spend reviewing agent code can be focused on actual behavior.
The CC-5 rule specifically seems to be (just from reading through, nothing repeatable-eval based) the part that actually catches and prevents me from having to clean it up afterwards.
```
### Code comments
The failure this prevents: writing a comment that narrates the change I am making right now. That context is real, but it expires the instant the change merges — the defect it describes no longer exists, so the comment becomes a story about a problem no future reader can observe. It is a changelog entry in the wrong file, and a third copy of text already required in the commit body (3.b) and the PR description.
- *CC-1 (MUST NOT)* Write a comment describing a change, a fix, a defect, its cause, or what the code used to do. No "was/now/previously/instead of", no "this fixes", no "needed because otherwise", no "note that we no longer".
- *CC-2 (MUST)* Apply the survival test to every comment before writing it: would this still be true and useful to someone reading this file a year from now, who never saw the diff? If it only makes sense beside the diff, it is changelog — delete it and put it in the commit body.
- *CC-3 (MUST)* Default to zero comments. Declarative config — Terraform, DNS records, k8s manifests, CI YAML, Helm values — is self-describing and takes none. A resource named `dmarc-example-com` does not need a comment saying it is the DMARC record.
- *CC-4 (MAY)* Comment only when a future editor would actively break something without it: a non-obvious external constraint, a required out-of-band manual step, an invariant the surrounding code cannot show. One line. If it needs a paragraph it belongs in `plans/`, not inline.
- *CC-5 (MUST)* Before every commit, re-read the comment lines I added: `git diff --cached | grep '^+' | grep -E '#|//|/*'`. Each hit must pass CC-2 on its own. Deleting is always an acceptable outcome. "I already wrote it", "it is only one line", and "this one is genuinely useful" are not exemptions — the last one is the exact thought that precedes every violation.
- *CC-6 (MUST)* Applies to comments I edit as well as ones I add. When a change invalidates an existing comment, the default action is DELETE, not rewrite it into a new narrative.
```
Yes, I am aware that claude mostly generated this, and it can probably be better and/or more succinct.
Specifically, I like the "canary" trick that people have discussed where you add a small, innocuous rule to your CLAUDE.md like "When responding to me, start every sentence with my name." so that when Claude stops doing this, you know you've used way too much context and need to start a new session.
```statusline-command.sh
#!/bin/sh
input=$(cat)
model=$(echo "$input" | jq -r '.model.display_name // empty' | sed 's/ context)/)/')
effort=$(echo "$input" | jq -r '.effort.level // empty')
used=$(echo "$input" | jq -r '.context_window.total_input_tokens // empty')
out=""
[ -n "$used" ] && out="ctx: $(( used / 1000 ))k"
[ -n "$model" ] && out="$out / $model"
[ -n "$effort" ] && out="$out $effort"
# bright yellow + bold
printf '\033[1;93m%s\033[0m' "$out"
```And here is where naive people will say something like "Why do I care if robots shit all over the codebase? Code is for machines, I don't expect to deal with it much now". But really externalized CoT like this confuses machines too, wastes tokens, and eventually wastes exponentially many tokens. Agents tend to think it's more real grounding than prompts are, even for comments-in-code. One bad comment poisons everything, then gets copied around as a ground-truth assumption everywhere. Hooks are more real to them than prompts or comments, and even then if you add enforced limits and tell them to externalize CoT ONLY in scratch task-tracking docs.. they will violate comment-enforcement hooks about 25% of the time. That tells you everything you need to know: even with constant reinforcement, they just really want to break this kind of rule.
The current output style does work, but it’s a Sisyphean task to tweak it constantly only to find out that CC adhere’s to only 75% of it, no matter what…
So the options are a) being a really aggressive stickler for generative hygiene with deterministic rules, b) being massively wasteful about hiring a few machine janitors for every machine coder, or c) humans become the machine's janitor. If I haven't missed an option.. only the first option seems reasonable here.
You know the problem; then why not address it? Does Compacting the context not help?
Depending on the initiative I might compact a session a dozen times, sometimes more. It is lossy, and the session certainly tends to forget earlier bits as more compactions happen, but overall it's a much better experience than starting fresh and having to re-explain everything.
The only time I compact is if the session goes wildly off-course and the context gets polluted with off-topic conversations.
Also worth noting: with Claude Code you can provide custom instructions when compacting, and instruct the LLM that is in charge of compacting the session to prioritize the retention of specific bits. It can help a lot.
To be fair, I've had it do that immediately after re-reading the output style instructions, too.
My chat history is filled with "Yes, I broke the language rule. Let me rephrase that and update my memory. — You already have that in memory — Yes, true, I ignored that" (because "Memory" is a yet another .md file)
Depending on what you've got in those files, maybe that will just use up all the context again though.
Keyword "supposedly" :)
I've had it in my settings forever, and still...
Asking it to analyse and fix the issue it produced a plausible "my training supercedes/overrides settings especially if triggered by certain words in the phrase" (paraphrasing the long text)
> I've had it in my settings forever, and still...
Checks out! I've never used it my self, so it I figured it likely didn't work at all.
Intermittent nudges
I had it fix something then went and reduced one of the 3 line comments to 4 words. Then for some reason I told the bot to reload the source, it offered to make the other comments terse and did a passable job of it. Shocking!
Now how to get it to do that all the time...
Of course, you have to intuit a reasonable line length, but Claude cries if you happen to clip its wings too aggressively.
I haven't had the same problems others have but I'm also not a heavy user of it.
Claude, since Opus 5, speaks more and more like a wannabe-thought-leader pontificating on social media for engagement. Everything is a bait-then-switch, or a multi-post story format. The "engagement" that works well for social media makes actual work extremely frustrating.
My unsupported belief is that this is caused by an obnoxious number of people using previous models in an attempt to automate social media engagement, they figured out what worked, and that was fed directly back into newer model training (either by using thought traces in training, or just by continuing to scrape social media content)
One of the reasons that "don't do X" type of instructions work reliably is because you are telling the model "don't think of a pink elephant". There's also Anthropic's related research that shows that when you tell a model "don't do X", and it does X later for whatever reason, it starts acting more misaligned. This is because it thinks "well, I guess I am the sort of model that disobeys instructions, whatever" - this was specifically about cheating on tests, but you can imagine this happens in other contexts as well like following instructions on what kinds of text to output.
So, what you want to do is to avoid telling Claude "don't do X", and tell Claude "in your thoughts, in memories and various notes that you write, use your Claude-ese. In your output to humans, translate everything into long full sentences."
If anyone's interested, I can share my Claude Code output style that reflects this.
(Hi Adnan! Long time! (Adnan is an ex-coworker))
Nope, I just tried it out myself recently and... wow. In the very first conversation it started glazing me about being right to push back, having the crucial insight, and something something the load-bearing-whatever.
So yeah, I'm on the same page as you, how on earth have they not fixed it yet? Do people like it? I added a system prompt to tell it to stop doing it and it's helped a decent bit already. ChatGPT/Codex has some annoying bits of prose but it never did this, so it can't be that complicated to get rid of.
They might even have a version that writes less annoying prose, but they are being squeezed hard by OpenAI and the Chinese so unless it performed better or equal to the annoying one it’s never left the lab.
I did not see an explanation though.
The moralizing is incredibly obnoxious as well. It didn't seem so bad at first, but it instantly became intolerable the second I remembered I was paying for those tokens.
One of the comments was one guy saying “how he loved to live in Missouri and eat concrete soup” or something like that.
I was too lazy to write a similar reply and asked Claude, instead of saying no, it wrote 3 paragraphs about how I shouldn’t write about eating concrete soup and how it is dangerous to do so.
"Vomit: Clean up Claude 5's token output with a separate LLM" (github.com/zachahn)
285 points | 23 hours ago | 288 comments
"Claudish to English" (https://github.com/gvzdv/claudish-to-english)
4 points | bryan0 |10 days ago | 2 comments
You have literally no way to know that.
It was revealed to me in a dream.
> My suggestion to you is to take this shred of skepticism that you decided to apply to me,
I apply my skepticism liberally, but you couldn't possibly know that.
And your reasoning to get to this conclusion? Obscured like Claude’s thinking traces?
(A model that can run reasonably well in a ~24GB MacBook.)
So for the parent's Macbook question `gemma4-26b-mlx` should work well.
For you with 24 GB VRAM, `gemma4-26b-a4b`. I tried higher VRAM models and they slowed down while still doing just as well or slightly worse.
If someone else tests and finds a better performing model though, please update me here, I'd love to try it.
Let me ground my answer so I'm not just guessing. The blast radius of this change is significant and requires careful surgery to get right.
It's clear now and there's two options going forward: A. Use this tool OP suggested B. Rewrite the Internet from the ground up without this clear contradiction in place - 3-5 days
I recommend B and started 3 subagents to read all the code before I get started. I'll wait for them to finish.
Someone made a Claude version of her skills:
I put it at the top of CLAUDE.md. I wonder if I put at a 8th grade level, it would be less of a cognitive load.
Better just clean stuff up afterward with a dedicated agent.
As much as Claude's style frustrates me I can't say I'm willing to pay for double the tokens to fix it.
> The last one guesses its own refusals, marking the door open before we walked around it. Say the word and I'll do the joinery
Like WTF are you even talking about
ex:
* Currently trying to make sure open models are regulated out of existence.
* More concerned about preventing distillation than providing actual value.
here is the line i use: use technical language to spell things out, and keep it free of jargon and project shorthand
why do you choose gemini? imo this is a fundamental problem of all frontier ai models.
I prefer this since everyone has their own preference for how the output should sound and it's very simple and transparent. And you can easily ask follow-ups.
It can be via tmux, or herdr, because it can read the pane.
Or it can use a hook to read the conversation file. I call it `backseat-driver`
I sometimes use it as a proxy when fable genuinely does a good job, but is too difficult to understand.
I let the translator know it's role and anything I say it should forward with better context.
I don't swear at it anymore, but I'd often say "just do it, retard", and the translator would actually steer it in a useful manner.
I have grown tired of Codex/GPT's writing style, too, but it's not nearly as bad. It's terse and factual by default. Even better if you use the "simple english" skill.
I actually found that GLM 5.x is the best in terms of editing documentation. It's still best to write things by hand to give your own organic voice, though. And not insult your readers.
Haven't tried, because I have just been using 4.6 since 5 was released.
Claude will eventually ignore it just as any other style like "Technical".
Should be pretty difficult to ignore
Avoid the stock LLM register.
Sigh.Also, Westworld? These violent delights have violent ends? Perhaps there's a tinge of Pascal's wager to it, but I prefer to be courteous to the rapidly improving synthetic intelligences.
I was just informing people that Anthropic gave Claude a tool that ends conversations and instructed it to use it via the system prompt if it's threatened or insulted.
I've been saying this since probably a year, that the entire Claude product: from the sign-up, the payment, the UX, the UI, the harness, the intelligence itself, the output, the "flavor" ..is just so mid that all the hype posted on HN about Claude must have been paid PR or a case of the emperor with no clothes.