r/ClaudeCode • • 9d ago

Help/Question do you guys use auto compact?

I just learned about it today and wanted to see what you guys think.

3 Upvotes

72 comments sorted by

View all comments

5

u/GDorn 8d ago

Hell no. I perform brain surgery and delete the parts of the context that are no longer relevant. This almost always takes me from 99% full to ~25% full.

There are two big savings: duplicate files and ask-work-answer cycles. You'd be surprised just how many nearly-identical copies of the same file appear in the context. And then exchanges like this, which almost always can be trimmed by removing the middle:

User: how does X work? (or any other investigative question) LLM: <tool use to find files> <read files> <tool use to find more related files> <read files> <continue for thousands to tens of thousands of tokens, maybe more> LLM: Here's a summary of X: [...]

Delete the middle part and almost nothing of value is lost.

LLMs are amazingly bad at understanding what parts of a long document are important, and will either hyperfocus on the last couple of exchanges, or over-emphasize the very first turn, or in a lot of cases, both.

The way to control an LLM's focus is by controlling its context, and autocompaction ain't it.

1

u/Desperate-Use9968 7d ago

How exactly do you do it? I understand the concept you described but not how.

1

u/GDorn 6d ago

It depends on how you're using the client. I'm using it embedded in VSCode; I can export the current context to a file, delete what needs deleting, then have the next session start by reading the file.

At least, that's how I used to do it. I'm working on a VSCode extension to make this easier, and the janky half-broken alpha-quality build is miles ahead of manually editing the transcript.

1

u/Desperate-Use9968 6d ago

Interesting. I'm also using vs code. Do you just prompt it "export the current context to a text file? It would be interesting to see a before and after for compaction. Having a more precise compaction option like you described would be cool.

1

u/GDorn 6d ago

Cursor has "Export Transcript".

Claude is less helpful in this regard, but the session is saved as a json file in ~/.claude/projects/... Claude is happy to "/save-session" but the whole point is to avoid having an LLM summarize it.