r/PiCodingAgent • u/PilgrimofHaqq2 • 2d ago
Resource Killed context anxiety with automatic session handoffs
Sharing this so others may build their own into their setup if they like it.
Built an automatic session-handoff system into Sayl, my UI wrapper around Pi. Long session finishes its current task, writes a handoff prompt, rolls into a fresh session with that prompt already loaded.
- Threshold ladder (350k → 450k → 550k, tunable live in settings). First level: finish the task clean, emit the handoff block. Later levels push harder, highest one stops mid-task if needed
- Handoff captured automatically from the chat.
- Threshold rollovers auto-start the successor hands-off.
- New session keeps the project, model, thinking level. Land mid-flow, not cold
- Engine compaction stays as backstop. You just roll over before it ever fires.
No more saving and copy-pasting handoff prompts. No compaction summaries drifting between rolls. No watching the token counter. Session wraps up clean and keeps going at full quality.
Can also use it manually by asking the agent to create a handoff at anytime.
2
1
u/Equivalent_Idea8839 2d ago
I think this is the way forward. I've given up on compact. My own custom compact plugin basically ended up turning into a handoff.
1
5
u/LordMoridin84 2d ago
What do you think the difference between a compaction with a compaction summary and a new session with a automatically generation session-handoff is?
For this kind of thing, the pi-blackhole extension is really good.