Your Agent Doesn't Need Another Summary. It Needs Its History.

Agent retrieving history from a previous session instead of relying on a summary

One thing that bothers me about long-running AI agents is context compaction.

When the context window fills up, most agent harnesses ask an LLM to summarize the conversation and continue from there. It works, but summaries lose details, and after a few rounds of summarizing summaries, things can drift quite a bit.

The funny thing is that we already have the entire conversation stored on disk. Why not just let the agent look things up when it needs them?

[Read More]

Compact Before You Switch: My First Pi Extension

The pi-compact-before-switch extension catching a switch from MiniMax M3 to GLM-5.1 before the context overflows

Pi lets you switch models mid-conversation. That’s the feature. You start a session on one model, then switch to another with /model or by cycling with Ctrl+P - whichever model fits the next stretch of work best. Most of the time it just works.

Here’s the time it doesn’t.

You’re deep in a session on MiniMax M3 and its roughly 1M-token context window. Your conversation has grown to 162,000 tokens - fine, plenty of headroom. Then you switch to GLM-5.1 because it’s the model you want for the next part of the job. You’re thinking about the model, not its context window - and GLM-5.1 tops out at 128,000 tokens. Your conversation no longer fits. Many providers won’t warn you about this; they truncate silently. The model on the other side of the switch is now missing the front of your conversation, and you won’t find out until it starts confidently forgetting things you told it ten minutes ago.

[Read More]