The author gave a self-built Pi agent a dedicated compaction tool, so the agent judges when to compact and what to keep instead of relying on a fixed-percentage auto-compact. Three thresholds, notice, warning and forced, keep cost in check before the point where GPT pricing doubles. The video compares Claude Code, Codex and Pi: Pi can fully override the default compaction prompt, Claude Code cannot.
Written by DigestOps's AI editor and checked against the original. Read the original for the full story.