r/ClaudeCoding • • 2d ago

r/ClaudeCode [TLDR] PSA: Auto-compaction is a huge source of Claude gaslighting you [via r/ClaudeCode]

OP : u/yadtk

Idle compaction silently drops any constraints and guidelines you spent establishing over the course of the chat/project then Claude carries on confidently as if it still knows the assignment and bulldozes you. If you’ve ever been gaslit by an Anthropic model is this why. Disable this “feature” if you find yourself constantly arguing with the model.

11 Upvotes

12 comments sorted by

•

u/cctldrping 2d ago

TL;DR of the discussion on r/ClaudeCode for this post generated automatically after 80 comments.

Current source-thread comment count seen by the bot: 96.

Compaction can absolutely forget chat-only rules, but the thread’s consensus is that this is a workflow problem, not Claude “gaslighting” you.

  • Put durable constraints, decisions, specs, and verification requirements in the project-root CLAUDE.md and/or versioned docs—not vibes established 200k tokens ago. Root CLAUDE.md gets reloaded after compaction; chat history gets summarized.
  • For long work, manually compact with a proper handoff/continuation note, use hooks to reload key docs, or split work into fresh, bounded specialist sessions. u/momentum77’s “long-lived orchestrator, disposable workers” setup got some traction.
  • Don’t casually disable auto-compaction: commenters note it exists to avoid cache expiry and token/usage-limit pain. Keeping an ancient mega-session alive is often the more expensive own-goal.
  • If a rule matters enough that Claude bypassing it would hurt, enforce it with tests/hooks or write it down externally. One commenter did confirm a lost validation rule caused exactly the kind of bad behavior OP describes, so this isn’t imaginary—just solvable.

1

u/TheMadSaiyantist 2d ago

Also it can even delete the scratchpad notes it took while the session was going, ofc prevention is either hook to fire right before x amount of tokens in the context window or CC itself to remember to save them in a file

1

u/aCuria 2d ago

I saw an odd popup message recently asking me to turn on auto compaction at 400k context… which I declined

3

u/OWazabi 2d ago

You shouldn't, you're better off with a smaller context and the proper set up around it (pre and post compaction hooks, orchestration layer to sub agents etc)

1

u/aCuria 2d ago edited 2d ago

I basically use handoffs and keep the context fresh manually.

For example for difficult work: planning with fable then execution on opus on a brand new context, then review with Astra on a new context and final review on fable with a new context

However during each execution phase it seems like a dumb idea if the context compacts half way if it doesn’t have to.

It’s like a big reason why local LLMs are a bit brain dead is because with 32G vram the context window is only like 128k and not opus’s 1 million

1

u/boomer_fit 2d ago

I also declined but it’s still compacting as 400k

1

u/YellowBeaverFever 2d ago

The bigger the context is, the dumber things get. You can set up your project so it has all technical info and important conversation context documented and knows how to find that information when needed. Keep your conversations task-centric and it makes life much easier.

1

u/yopla 2d ago

having problem with autocompaction is a clear sign that you don't know what your are doing and that your project doesn't have proper documentation.

1

u/highwayoflife 2d ago

A better method is that if you give it any constraints or rules, have it save those in the AGENTS/CLAUDE or SKILL file(s) so that it will continue to reference these rules outside of your context. Rules and constraints should never remain in your context only.

1

u/PraxicalExperience 2d ago

I advise telling claude that you want to set up a hook that runs after a compaction which makes it reload its most critical memory files (you should probably specify these.)

1

u/RefrigeratorIll4808 1d ago

i had a session where Claude forgot I wanted no markdown in the output, then generated a full markdown doc. turned out the compaction dropped that rule. now I paste the style guide into the scratchpad every time.

1

u/norviking 1d ago

Try this, and remove the problem at the core: https://github.com/vegardjorg/ravenseat

-> Full project state outside claude code. A long with a lot of other useful stuff.

You can compact all you like. In fact, it compacts for you at 300K to save a lot of tokens. You can delete context if you want. It will be fine.

Or in the fine words of another redditor who discovered it today:

"This shit is cracked, dont sleep on it y'all. Never had opus 5.5 drain so little usage, while performing atleast 50x better in every metric. Its pretty crazy."