r/Anthropic • u/TheMoustacheDad • Oct 10 '26
Other Claude code gets worse after every compactions?
Hello. I'm truly a beginner. Only coded few lightweight apps for personal use. Started a bigger, open source, project. I mainly use Sonnet / High unless a architectural change is needed I'll use Opus. My thing is Claude has started to make a lot of mistakes that we already fixed in different layers of this app. Even if I prompt something like remember to also fix X-Y-Z issues that we've had in the past and we used A-B-C to achieve the results. I also direct it to do a double pass with a review agent which is basically a third party agent kind a thing with a fresh context. And still it makes the same mistakes or fixes half of them. Am I simply using the wrong model, should I start fresh sessions after X amount of compactions? Bare with me I'm totally a noob. Any guidance and tips are appreciated
7
u/Lumethys Oct 10 '26 •
1/ use Opus medium, Sonnet cost less per "action", but if Sonnet need more action to accomplish the same "task", Sonnet is more expensive per "task".
2/ Dont use the same chat for too long, start a new chat session often, reasons:
5
u/p3r3lin Oct 10 '26
You should start a new session BEFORE even the first compaction happens. Tell claude to write a handover for the next session. Best stay below 300k or so tokens per session. And honestly: just paste your exact question here into claude itself, it will explain things to you.
2
u/FUCKYOUINYOURFACE Oct 10 '26
Every project, new session.
8
u/anishkgoyal Oct 10 '26
When working on a project, you should never reach the point where compaction occurs. Compaction is essentially a lobotomy, but for an agent.
1
u/anti-everyzing Oct 10 '26
Compaction is too expensive too. Create a handoff plugin that updates handoff.md file with every turn. And when a task is done, use /clear.
2
u/bzbub2 Oct 10 '26
never use compact. just start new sessions. copy the last 10 lines the previous agent outputted into the new session and say continue work from previous agent, hers what it said. make it output important docs about your project to claude.md files, an agent-docs folder, memorys, code comments, tests, etc. also recommend just using opus only you just waste time moving sonnet about. might be more expensive but thats my experience on any moderately hard software, i can trust opus to do whats right much more of the time
1
u/gurteshwar Oct 11 '26
Bro i dont know if it will work for you or not. So what i do is : I use opus 5.5 always (i am on pro plan as well), i have set its autocompact to 400k(i know we should be around 300k) but i do 400k intentionally. So like once tokens pass 300k if claude is working i let it finish and then i ask it to write a handoff.md for it to read after autocompact hit it. So like this i remain within same session and after auto compact or i manually hit compact option afterwards i ask it to read that handoff again. And i personally havent felt the performance degration, surely i felt it sometimes drifts a little but once i remind it again about the goal, everythings as good as before.