Self-Compact Pi Agent: ZERO HYPE Agentic Coding Devlog

From the creator

Your agents are smart enough to know when their own context window is full. So why are you letting Claude Code and Codex decide when they compact? πŸ”₯ Auto compaction at a fixed percentage is the DEFAULT. Defaults are for engineers who don't own their harness. 😲 Phase 3 Early Sign Up is Officially Available: https://agenticengineer.com/ia3-pre-launch?y=3b0U4_02bAE πŸŽ₯ VIDEO REFERENCES β€’ Self Compact Pi Agent Codebase: https://github.com/disler/self-compact-pi-agent β€’ Astra Agent Swarms: https://youtu.be/S2sjyokoxeE β€’ WHERE to FOCUS your AGENTS: https://youtu.be/rPWCYB62wvI β€’ Pi Agent: https://pi.dev/ In this agentic coding devlog, IndyDevDan builds a self compacting Pi agent: a context aware agent with its own dedicated tool to decide when to compact, what to preserve, and how to continue. Then we hand the same plan to three harnesses (Claude Code, Codex, Pi) running Fable, Astra, and GLM and see which one actually ships. πŸš€ The context window is the one problem no agent escapes and no engineer can ignore. It has been with us since the beginning, and controlling it is still a massively untapped opportunity. Long running autonomous agents (like a ten to hundreds of agents swarm churning for hours) run out of context, rot, and burn cash. Self compacting agents fix this by giving the agent awareness of its own context and letting it choose the moment to compact. πŸ› οΈ What we build with harness engineering on the Pi agent: Self Compact Tool: A dedicated tool the agent can call at any time to compact its own context and leave a note to itself that survives the summary. Three Thresholds: Notice, warning, and force. A wide gap before the warning so the agent can find a natural stopping point, a short gap to the hard cutoff where the harness blocks every other tool. Full Prompt Control: We override the default compaction prompt, the soft notice, and the warning prompt. Every agentic coding tool has a baked in compaction message. Pi lets you replace it. Claude Code does not. Context Bar UI: Cached tokens, uncached tokens, free context, and all three markers rendered live in the terminal. Cost Aware Defaults: Thresholds tuned around the 270K mark where GPT pricing doubles, so the agent compacts before the bill does. πŸ”₯ The devlog starts where all great work starts: a hand written draft plan. Problem, solution, workflow (plan, build, verify), a definition of done, and a "how you're graded" rubric that taps into how these models are trained inside the labs. Then we stop typing and move at the speed of agents. That translation step, your expertise encoded into a prompt your AI agents can execute, is the real edge in agentic engineering now. Three harnesses, three models, one prompt. GLM 5.2 hit 98 percent context and could not finish (the exact problem this build solves). Claude Code on Fable 5.1 shipped in 50 minutes on 500K tokens. Codex on GPT-6 Astra shipped in 21 minutes on 136K. Then we stress test the results with DeepSeek V4 Flash and GLM Flash through OpenRouter and watch the agent notice, warn, write a note to itself, and compact on its own. πŸ’‘ Master the core four (context, model, prompt, tools) and you master the agent. Master the agent and you master knowledge work. Context engineering is not about saving tokens. It is about teaching your agents when to compact, what to keep, and how to keep going when you are not in the loop. 🌟 The tools you use directly limit what you believe is possible. Claude Code is now copying this kind of customization with its own plugin system. Where do you think that came from? Open, customizable harnesses like the Pi agent. Build the feature you need, not the feature you're given. Stay focused and keep building. IndyDevDan. #agenticengineering #contextengineering #aiagents

Choose to Build with AI
Matched to AI Agent Systems

AI Maker Residence at KOKO

The third AI workshop taught by our legendary teacher, Nick Sarafa. In one of the last events we did an asset manager raised an additional Β£25M on their fund within a space of 9 months. This is a full-day hands-on training workshop for purposeful co-creation with AI using Claude Code. Imagine having access to hundreds of billions of dollars of computing power and knowing exactly how to make it work for you through the power of super intelligence. One person did.

β—† Fri 09 Oct 2026 β—† KOKO Cafe, London β—† With Nick Sarafa
AI Maker Residence at KOKO
Live event
AI Maker Residence at KOKO
Fri 09 Oct 2026

More like this

Running one yourself?

List your AI event,
wherever it is.

A meetup, a workshop, a hackathon, a conference. Any city, or online. Tell us about it and it lands in front of people already learning this stuff.