Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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...

105,876 Aufrufe • vor 8 Monaten •via X (Twitter)

34 Kommentare

Profilbild von Hakan Deryal
Hakan Deryalvor 8 Monaten

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.

Profilbild von Karim C
Karim Cvor 8 Monaten

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.

Profilbild von Lukin
Lukinvor 8 Monaten

Why not use?

Profilbild von Fabien Butz
Fabien Butzvor 8 Monaten

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

Profilbild von alex morris
alex morrisvor 8 Monaten

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

Profilbild von Domi Young
Domi Youngvor 8 Monaten

Is the ui of Web the same as the terminal?

Profilbild von jan
janvor 8 Monaten

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

Profilbild von Michael Vessia
Michael Vessiavor 8 Monaten

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

Profilbild von DgtlDev
DgtlDevvor 8 Monaten

Got it. Thx

Profilbild von Eyyüp Sayli
Eyyüp Saylivor 8 Monaten

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.

Profilbild von Viktor Bonino
Viktor Boninovor 8 Monaten

Also skills.

Profilbild von BLACKBOX AI
BLACKBOX AIvor 8 Monaten

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.

Profilbild von Angel
Angelvor 8 Monaten

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.

Profilbild von Andre Buckingham 🧙‍♂️
Andre Buckingham 🧙‍♂️vor 8 Monaten

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

Profilbild von Karan Jagtiani
Karan Jagtianivor 8 Monaten

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?

Profilbild von Brad Dangerfield
Brad Dangerfieldvor 8 Monaten

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

Profilbild von Ben Cera
Ben Ceravor 8 Monaten

Lost context is just lost dreams.

Profilbild von zby
zbyvor 8 Monaten

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

Profilbild von Sushma Rao
Sushma Raovor 8 Monaten

Interesting.. thanks for sharing.

Profilbild von barthazian.eth 巴特
barthazian.eth 巴特vor 8 Monaten

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

Profilbild von Deva.me
Deva.mevor 8 Monaten

Compaction trades continuity for convenience. Once you invest in explicit context design, forced summaries start feeling like silent data loss.

Profilbild von Himanshu Kumar
Himanshu Kumarvor 8 Monaten

@dani_avila7, losing context is a significant drawback with auto-compact, so your approach makes sense.

Profilbild von El Ingeniero
El Ingenierovor 8 Monaten

I use a continuity ledger that gets updated when I hit any milestone. it remembers the important stuff.

Profilbild von cheickMouhamed
cheickMouhamedvor 8 Monaten

Nice . Thanks for sharing

Profilbild von Glitch NFT Studio
Glitch NFT Studiovor 8 Monaten

i just have calculated ctx % in status line so keep track of it real time. Once get to danger zone compact or clean.

Profilbild von Bitplanet
Bitplanetvor 8 Monaten

Context integrity beats aggressive compression. Explicit session control preserves signal where auto summaries quietly leak meaning.

Profilbild von Sourced by SEORCE
Sourced by SEORCEvor 8 Monaten

context over compression

Profilbild von Max Leander
Max Leandervor 8 Monaten

Same pain led me to build a memory system that survives compaction. Fractal structure means Claude keeps the gist even when tokens get crunched.

Profilbild von jayjaytinker
jayjaytinkervor 6 Monaten

Matches my experience. The upfront config pays off. What helped: keeping commands scoped to one job each, and using hooks to inject project context only when needed — not loading everything into CLAUDE.md. Context stays cleaner and auto-compact stops being a thing.

Profilbild von Adam
Adamvor 8 Monaten

I do both. 🤷‍♂️

Profilbild von Volatile Markets
Volatile Marketsvor 8 Monaten

@claude-mem seriously. Try the new V9. It’s worth the time..

Profilbild von Juuno
Juunovor 8 Monaten

i get that, losing context sucks

Profilbild von Luong NGUYEN
Luong NGUYENvor 8 Monaten

I also have it turn off, with a custom status line, I can see immediately how much window I have left, estimate how many remaining tasks need to be done, then decide whether to go with a new session or continue.

Profilbild von Maximiliano Rodríguez
Maximiliano Rodríguezvor 8 Monaten

Can you share it?

Ähnliche Videos

I got curious how compaction works as a PM, so I did some brain surgery on Claude Code: (Anthropic's been doing really interesting work on context editing - they showed Claude Opus playing Settlers of Catan for 75+ minutes in a single thread by constantly editing the context instead of starting fresh. When I saw that Claude Code has a compaction command with optional custom instructions, I wanted to understand what's actually happening.) Abhishek Katiyar and Aman Khan gave me the key tip: Claude Code stores all your conversation history as text files on your computer. Open a new directory and give Claude Code a task. Here's how to watch compaction happening: 1. Go to your user's root directory 2. Press Command+Shift+Period (Mac) to show hidden folders 3. Navigate to ~/.claude/projects/ 4. Find your project folder and use Cursor/VSCode to open it (there's a reason) 5. Install the JSONL Gazelle plugin (open source, thank you Gabor Cselle!) 6. Open the most recent JSONL file - each row is a message in your conversation 7. Run the compact command in Claude Code with custom instructions 8. Watch what happens in the file What I learned: When you compact, Claude Code doesn't just summarize and delete everything. It creates a "compact boundary" in the conversation file, writes a summary of what happened before, but keeps the full original conversation (!!!!) The new thread can still retrieve any details from before compaction if needed. That is so damn cool. Why this matters: What you're getting in Claude Code is similar to what Anthropic ships in their developer SDK - so inspecting your daily tools is how you build real product intuition. The best way to understand AI systems is to open them up and look inside. Everything is text files.

Tal Raviv

57,910 Aufrufe • vor 8 Monaten

THIS MIGHT BE THE #1 OPEN-SOURCE REPO FOR CLAUDE CODE RIGHT NOW. IT GIVES CLAUDE A MEMORY AND SLASHES YOUR TOKEN COST ON EVERY QUESTION The repo is safishamsi/graphify, a free open-source skill that turns any codebase into a knowledge graph Claude Code can read instantly. Instead of grepping through your files every session, Claude gets a map of how everything connects The problem it fixes: Every time you ask Claude Code about a big repo, it does the same thing, greps through dozens of files like a brute-force Ctrl+F, blows through your context window, and sometimes still misses the answer hiding in a file nobody searched. Claude Code has no memory of how your project is structured. Every session starts from zero What it does: It maps your entire codebase into a knowledge graph, capturing not just which files exist, but which functions depend on which, which modules are central, and which files cluster around the same concern. Claude queries the map instead of scanning files How it works, three passes: 1. Code structure, free and local. Tree-sitter parses your files and pulls out classes, functions, imports and call graphs. No LLM, no tokens, just your actual code mapped deterministically 2. Audio and video, if you have them. Transcribed locally and folded into the graph 3. Docs, papers, images. Here an LLM does semantic analysis, figuring out what each document means and where it fits. Only the meaning gets sent up, never your raw source It saves you money: Normally a question about a big repo makes Claude spawn explore agents that scan file after file, eating your context window and your token budget before you get an answer. With the graph already built, Claude queries the map instead of re-reading the codebase every time. Same answer, a fraction of the tokens. The graph only gets built once, then a hook rebuilds it after each commit for free, so you never pay that scanning cost again. The bigger the repo, the bigger the gap The best parts: it's a skill, so once installed Claude knows when to use it without you memorizing commands. It works on non-code folders too, point it at docs or notes and it can spin up an Obsidian vault How to add it to your Claude: 1. Install Claude Code if you haven't: npm install -g Paul Jankura-ai/claude-code 2. Add the skill: claude skill add safishamsi/graphify 3. Open your project folder and run /graphify . to build the graph 4. Optional, make it automatic: graphify hook install so the graph rebuilds after every commit That's it. Ask Claude about your repo and it reads the map instead of burning tokens on a file hunt Bookmark this

Yarchi

56,177 Aufrufe • vor 3 Monaten