Pi 1.0 ships codemode: on-demand tool loading cut a GPT-5.6 prompt from ~5,300 to ~3,300 tokens
solyarisoftware · x · 2026-10-03
Pi 1.0 is out, headlined by a codemode mechanism that tackles tool-context bloat in agent workflows, plus direct image-model invocation from code mode.
How codemode works: instead of stuffing every tool's description, parameters, and return schemas into the prompt up front, the model first sees only a short MCP server intro, then searches for and reads specific tool docs on demand. It then writes JavaScript to orchestrate calls—parallel queries, chained results—and large tool outputs can be filtered, aggregated, and trimmed inside the script before only the needed fields enter the conversation. Savings come from both ends: lazy tool loading before the call, output shaping after it.
Numbers and caveats: in the official example, a default-tools-plus-codemode GPT-5.6 request dropped from 5,300 to 3,300 prompt tokens (about 38% less). That figure is config-specific; real task-level savings depend on setup and script quality, and directly exposed tool declarations plus full result dumps still consume context.
Also new: model-friendly error messages (near-miss tool names, expected parameter shapes, guidance to list valid models), and further trimming of codemode docs, tool descriptions, and system prompt content.
Related event: Pi 1.0 Released: Codemode Cuts Prompt Tokens by ~40%(3 posts)→
More from coding & agent
- Dev plans human-in-the-loop email gateway so AI agents never touch his inbox directly — tomchapin · 2026-10-03
- Solo dev builds an off-market real estate deal pipeline with Claude — and hits the data wall — italimade · 2026-10-03
- OpenClaw v2026.9.8 ships GPT-6.1 Sol support across 43 PRs, cuts memory use — heyneighbor · 2026-10-03
- Building personal productivity meta-tools is now fun: bash scripts have become full-blown apps — devenbhooshan · 2026-10-03
- K-Dense BYOK: Open-Source AI Co-Scientist Runs Locally With a Tamper-Proof Lab Notebook — RexDouglass · 2026-10-03
- Google paper: clean-context verifiers let explorer agents try wild proof ideas safely — solyarisoftware · 2026-10-03