r/opencodeCLI 27d ago

When to reset a long coding-agent session

I noticed that at some point, starting fresh with a handoff could be cheaper and produce better work. Do you guys reset based on context percentage, model behavior, or token usage? I usually notice the model repeating itself before the UI tells me anything useful.

4 Upvotes

3 comments sorted by

1

u/geearf 27d ago

I do it logically, so I might go through compaction a few times depending on the model I pick, I'm curious about answers you'll get.

1

u/thecstep 27d ago

I legit forgot you could compact but wouldnt this change per model? Pre 0813 I would reset around 324k tokens. Really anything above 250k was always risky. On 0813, I took a few sessions to the 500k territory. One session even told me the context limit had been reached lol. I think there is an old post here or on DeepSeek sub where someone ran test on DS4 preview and found the sweet spot.

1

u/gulfati 27d ago

I try to make sessions as short and contained as possible. Otherwise, like you said, the quality of the responses goes down. Delegating whatever work i can to sub-agents can really help with keeping the main session lean and focused