Skip navigation
I’ve been asked a lot why I keep Claude Code auto-compact turned off. Here’s why 👇
0:00 / 0:27

I’ve been asked a lot why I keep Claude Code auto-compact turned off. Here’s why 👇

Daniel San

@dani_avila735K followers

Visit on X
602 likesDownloadOriginal post

105,916 views

I’ve been asked a lot why I keep Claude Code auto-compact turned off. Here’s why 👇 If you configure commands, sub-agents, and hooks properly, you almost never hit auto-compact. Every time it triggered for me, I lost important context. After looking at how compaction actually works, it was clear that key details were being dropped. So I disabled it and focused on better context management per session instead. If you want to see what happens under the hood when a compact runs: npx claude-code-templates@latest --chats You’ll get a full breakdown + per-session analytics to keep improving your workflows.

34 Comments

Comments from the original post on X (Twitter)

  • Hakan Deryal's profile picture

    @hakanderyal

    I’m on the other side of that. Most of the sessions I use get through 2 or 3 compactions. But Opus with plan mode only goes off rails after 4 or 5, and that’s not every time. Plan gets referenced back after every compact automatically. It’s the key part.

    4 likes

  • Karim C's profile picture

    @BrandGrowthOS

    Same lesson I learned with prompt management. Auto-compact feels like a safety net until it triggers mid-session and erases the exact context the agent needed. Configuration discipline beats reactive failsafes.

    4 likes

  • Lukin's profile picture

    @iLukin

    Why not use?

    2 likes

  • Fabien Butz's profile picture

    @f_butz

    similar experience. /clear + document the plan in markdown beats auto-compact for me. you control what survives, not the algorithm.

    1 like

  • alex morris's profile picture

    @alex_d_morris

    you could try using subagents more - mine usually have precise prompts and die by pushing to a db or local store. if you use subagents properly your context compaction doesn't affect much @steve_yegge

    1 like

  • Domi Young's profile picture

    @DomiYoung___

    Is the ui of Web the same as the terminal?

    1 like

  • jan's profile picture

    @ironcarbs

    great take, I also have compact turned off after playing around with the config and analyzing the context window limits

    1 like

  • Michael Vessia's profile picture

    @michaelvessia

    I did the same pre-opus 4.5 but I've found my issues with performance degradation post-compaction to have gone away, or it's at least improved to the point where it's not driving me crazy

    1 like

  • DgtlDev's profile picture

    @DgtlDev

    Got it. Thx

  • Eyyüp Sayli's profile picture

    @eyyupsayli

    Mine is turned off as well. My process generally calls multiple agents, so they all have separate context windows. I use the main context as a manager. Even if I hit the limit, the API throws an error, and I switch the model to Sonnet 1M to continue and finish the work. Or you can copy the discussion /clear and copy that to continue.

  • Viktor Bonino's profile picture

    @ViktorB01

    Also skills.

  • BLACKBOX AI's profile picture

    @blackboxai

    That makes sense. Auto-compaction is a symptom of weak context hygiene, not a solution. When context is structured intentionally, you preserve signal and avoid surprise drops mid-workflow. That’s exactly the direction we optimize for, explicit context, scoped runs, predictable behavior. Do check out our latest release on multi agent Blackbox CLI.

  • Angel's profile picture

    @ziran_pu

    Analysis: Initial request: My response: (loop summarize) Files created. Errors/ Issues. Commits made. Primary request and intent. Key technical concepts. Files and code sections. Errors and fixes. Problem solving. All users messages. Current work. Optional next steps.

  • Andre Buckingham 🧙‍♂️'s profile picture

    @AndreBuckingham

    i use "handover to self" md created at 5%-7% then compact manually, and have done a whole refactor in one "session" with no issues through four five compactions... Have been thinking about making something local that can serve that function but for now the handover-to-self. md works perfectly for better continuity after compactions... that and four other "working md´s" eliminate this issue for me

  • Karan Jagtiani's profile picture

    @karanjagtiani04

    Totally get that. Context loss is a pain, especially mid-session. A solid config can really make a difference. How do you manage the balance between keeping context and performance?

  • Brad Dangerfield's profile picture

    @AnalyticsGenius

    I just used my research backed tools I built that handle context across swarms significantly more efficiently and don’t ever worry about it

  • Ben Cera's profile picture

    @Bencera

    Lost context is just lost dreams.

  • zby's profile picture

    @zby

    You don’t need to turn it off if you never reach the limit!

  • Sushma Rao's profile picture

    @magicwithAI

    Interesting.. thanks for sharing.

  • barthazian.eth 巴特's profile picture

    @Barthazian

    just wat I needed been getting compacted too much and keep spoiling the iterations