r/PiCodingAgent • u/whiterose0000001 • Oct 16 '26
Plugin I built a Pi extension so my agent doesn’t fall into the dumb zone.
I'm very much inspired by Dexter Horthy and Matt Pocock on this. Dex says a model gets worse once the context window is about 65% to 70% full, which he calls the dumb zone, and Matt keeps sessions around 60% to 70% and hands off past that line, so I use the same limit for my work and my startup.
I set the threshold with /context-threshold, usually 60 or 70, and on a long task I tell the agent to call context_window and watch the used percent. The report shows the window size, how much is used, how much is left, and the percent still left under my line, so when it says threshold reached the agent stops and writes a handoff, which I pass to a new session and continue from there. The handoff I use is Matt Pocock's handoff skill: https://github.com/mattpocock/skills/blob/main/docs/productivity/handoff.md
The extension does not compact the session, and it does not write the handoff by itself, so Pi's compaction settings stay as they are. I still tell the agent what to do when the line is hit.
Install it with:
pi install npm:@utpalsinghdev/pi-context-window
GitHub: https://github.com/utpalsinghdev/pi-extensions/tree/main/packages/pi-context-window
npm: https://www.npmjs.com/package/@utpalsinghdev/pi-context-window
I'm just open-sourcing the Pi extensions I use for work and my startup. They've helped me a lot, and I want other people to be able to use them too.
If it deserves a star, the repo is https://github.com/utpalsinghdev/pi-extensions
DEMO





