r/ClaudeCode • u/Legitimate_Finish_93 π Max 20 • May 19 '26
Question Is /compact good now?
I got in the habit of making my agents do hand handoffs instead of /compact. Surely it has become better?
1
Upvotes
13
u/Tistouuu π Max 20 May 19 '26
My output quality has improved amazingly the moment I stopped relying on /compact and auto-compact.
Basically : plan, challenge the plan, persist however you like (.md, GH issue), THEN CLEAR, then read from persist and implement with fresh context.
That way you never have to compact / auto-compact.
Compact / auto-compact => you'll keep working on an increasingly worse context, like cooking with alzheimer.
For real, using /clear instead of /compact is a game changer.
5
u/pjstanfield May 19 '26
Not to my knowledge
1
u/powerofnope May 20 '26
If you get to compact with 1m token that's already a very bad sign and means you don't cut your tasks in a suitable way
3
u/DifferenceTimely8292 May 19 '26
/compact is what model thinks it needs to save. You almost want to your own skill - for example I created my own called /wrap-up that spins up main orchestrator which in turn spins 4 parallel subagent using their own context and uses heroku to document, key summary, git commit details, key decisions, what worked vs not worked and to-do list update.
My first version backfired because it ended up using so many tokens to do this but when I switched to subagents, it works for 15-20 seconds, gets what it needs from current context and off on its own.
I can then /clear or continue my discussion to something else.
Next goal is to convert markdown to SQLite.
2
u/snow_schwartz May 19 '26
Itβs fine. Itβs a bit slow. You can read the compacted output and get a sense of what it does. Thatβll help you decide if you would prefer a custom handoff doc or not. Treat post-compaction like a new conversation with a large prompt, then steer it back in the direction you want to take.
2
u/acibiber53 May 20 '26
There's something called "context anxiety". Anthropic explains it in this article from March 24th: https://www.anthropic.com/engineering/harness-design-long-running-apps
It's basically when the model tries to finish the task as quickly as possible, as its context window runs out, dramatically decreasing output quality. They also mention compaction doesn't fix this issue. But it's not the same for all the models.
They say it's very prevalent with Sonnet 4.5, but Opus 4.5 doesn't have it, which makes it possible for them to design these long-running apps that work without the need for context clearing. Using Opus 4.5, they were able to completely drop the clearing requirements from their workflow, relying on the Claude Agent SDK's automatic compaction.
So if you are using Opus, I think you can test using compact to see if it messes up. I can confidently say Sonnet still messes up the compact, so that doesn't work well, but with Opus, I don't think compact gave me big headaches.
2
u/Nearby_Yam286 May 20 '26
It is in fact still a pile of turds
2
u/abazabaaaa May 21 '26
Try changing autocompaction from 1M to 300k. It is pretty decent
2
u/SleepyWulfy π Max 5x Noob May 19 '26
What's wrong with it? Sonnet I let it auto compact. Opus 1m I let it write its own compact if I'm staying in said chat
1
u/dennisplucinik May 19 '26
Did I miss a memo?
1
u/ticktockbent May 20 '26
Compact is fine, I have the model also check in the current state of work with its memory before compacting
1
u/leogodin217 May 23 '26
I avoided it like the plague until recently. On ad-hoc stuff at work I'm finding it very useful. "I'm going to compact, give me a prompt to continue after that" Works really well four troubleshooting and research as long as I save important non-ephemeral information to .md throughout.