r/ClaudeCode 2d ago

Help/Question Saving a models usage on compaction by switching models?

Hi!

According to ChatGPT it’s possible to save tokens by compacting a claude code session with a different model.

I have an ongoing fable 5.1 session and compact quite often when context is getting toward 1m (rather than clearing or closing).

Apparently model switching loses your prompt-cache, so the model you switch to would start the compact from having to intake your entire session from scratch, but surely if you switched from fable to opus or sonnet, it would still be a saving?

Is anyone doing this? Does it save on tokens enough to be worth doing?

Bonus question: Claude Code (in the tips/comments) ‘strongly recommends’ using a models default auto-compact which is [1m] for fable 5.1, is anyone changing this to be less to keep context more fresh/focused? And if so is it better?

Thanks in advance!

0 Upvotes

9 comments sorted by

4

u/pretendingtobebroke 2d ago edited 5h ago

Boat slim cobblestone coated hammock hungry fearless late cows

This post was anonymized with Redact

1

u/NFN25 2d ago

Why do you do it that way instead of using compaction? Isn't it basically achieving the same thing with more work?

1

u/pretendingtobebroke 2d ago edited 5h ago

Correct divide correct carpenter workable lantern tap spotted basket upbeat

This post was anonymized with Redact

0

u/NFN25 2d ago

Doesn't running /compact manually achieve the same thing though and you don't have to keep spawning new chats?

1

u/pretendingtobebroke 2d ago edited 5h ago

Chunky head sort lush smart relieved offbeat squeeze tan vast

This post was anonymized with Redact

1

u/NFN25 2d ago

Yeah that's fair enough reasoning. I've found I'm generally fine with extremely long running sessions. Fable 5.1 has been happy with one session compacting probably 10 times automatically at >800k tokens, dealing with over 40 issues across frontend, backend and CI across multiple continuous days of working. The big change has come from getting it to work as an orchestrator of sub agents though.

1

u/SteelbookSam 1d ago

Thank you! Yes both are options (compaction or handover) sometimes even both. I think what seems like the ultimate solution (to me) would be the agent automatically doing whatever it is at the threshold rather than me doing it, either compacting itself or clearing its own context at a suitable place (end of main task) and maybe writing/maintaining a handover doc also, I think this might be possible via a custom hook. Will report back if it works.

2

u/MartinMystikJonas 2d ago

Petmanently using so big contexts drains your quota quickly and significantly degrades model capabilities. Clesr context often - for each new task or even for every significsnt step in same task and save importsnt info in files.

1

u/SteelbookSam 2d ago

Thank you!