8/21/2026 at 3:21:40 PM
I've started giving these instructions and I think I've been much more successful in generating clear output: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.
by mmastrac
8/21/2026 at 3:26:15 PM
The problem is, when the context window grows, Claude tends to forget these kinds of rules. It will then do whatever it wants. I had to outright ban comments in the global claude.md, the local claude.md AND write a hook to catch any that still slipped through.by vrosas
8/21/2026 at 3:40:19 PM
I think people really need to focus more on working with limited contexts rather than trying to work around it. I really try to keep my sessions as short as possible and it helps a ton with keeping Claude (et al) focused.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.
by nater5000
8/21/2026 at 4:13:38 PM
This or you just repeat the initial prompt every 200k tokensby faizshah
8/21/2026 at 3:35:09 PM
> The problem is, when the context window grows,You know the problem; then why not address it? Does Compacting the context not help?
by mandeepj
8/21/2026 at 3:49:06 PM
Compacting the conversation almost never helps. It is uniformly worse than starting over with fresh context, or rewinding to a last-known-good state. It only exists because it increases engagement.by adastra22
8/21/2026 at 3:58:32 PM
Compaction is a main cause of this problem.by cautiouscat
8/21/2026 at 3:37:09 PM
Compacting context compacts context. So Claude forgets a lot during compaction.by troupo
8/21/2026 at 3:44:03 PM
Compacting mostly gets rid of reasoning tokens, and honestly it would be nice of reasoning tokens did not constantly follow every follow up query. Asking even a simple/trivial question can have Claude use thousands of tokens. Compacting is good for getting rid of those.by Maxatar
8/21/2026 at 4:35:43 PM
I've had Claude immediately fall back to its usual verbose style immediately after compaction.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)
by troupo
8/21/2026 at 4:00:27 PM
Yep. Same here. I frequently tell agents things like "answer using only a single sentence" and "write no more than 10 words". They are excellent at writing code, so have them write code (and not English prose). Besides, most of the time we want them to make reusable software that doesn't require users (or future agents) to read too much text. Software should generally just work and do the obvious thing, without needing verbose explanation.by kanzure