OptimalStack

Analysis

Why Pi's Tiny System Prompt Beats Bloated Coding Agents

New benchmark data suggests the tiny system prompt behind Pi outperforms heavyweight harnesses like Claude Code, especially with cheap open models.

Original broadcast by AICodeKing · Watch on YouTube

Quick Verdict

The core takeaway
A benchmark shows Pi's minimal-prompt harness completing more agentic coding tasks than Claude Code, Codex, and Open Code when paired with DeepSeek V4 Flash, at lower cost per success.
Key tool featured
Pi
Who this is for
Developers running agentic coding tasks with cheap open models like DeepSeek who want to cut costs without sacrificing success rate.

The Case Against Bloated System Prompts

Most coding agents load a massive system prompt before you type anything — Claude Code's was reportedly around 10,000 tokens of instructions and best practices. The problem is that these prompts are tuned for one specific model, usually the lab's own. Point a harness like that at DeepSeek, Kimi, or GLM, and the model is wading through thousands of tokens of guidance that were never meant for it — some helpful, some actively confusing, all of it costing money on every request.

Pi takes the opposite approach: a system prompt of only a couple hundred tokens that tells the model what tools exist and otherwise stays out of the way. Anthropic has since cut Claude Code's own prompt by roughly 80% with no measured performance loss, which the creator reads as tacit validation of the minimal-prompt approach Pi was built on from day one.

  • Favor minimal harnesses when running non-native models — less prompt means less friction with a model it wasn't tuned for.
  • Watch for hidden prompt bloat in any tool you use; ask whether those extra instructions are actually helping or just costing tokens.

What the Composio Benchmark Found

Composio ran DeepSeek V4 Flash through four harnesses — Claude Code, Codex, Open Code, and Oh My Pi (a community fork of Pi with extra power tools) — across 30 identical agentic tasks. Oh My Pi completed the most tasks (17/30), narrowly ahead of Claude Code and Codex (16 each), with Open Code at 14.//No single harness won every metric: Claude Code was fastest per task, Open Code was cheapest per successful task, and Oh My Pi landed roughly in the middle on cost but ahead on completions. Claude Code cost nearly three times more per successful task than the cheapest option. The creator's takeaway: a three-task swing out of 30 from changing only the harness is a meaningful gain that costs nothing, unlike waiting on a new model generation.

  • Weigh success rate over raw speed for background or unattended agent tasks — a slower agent that finishes correctly beats a fast one that doesn't.
  • Factor in cost per successful task, not just per-request pricing, when comparing harnesses.
  • Treat this as one 30-task benchmark, not gospel — directionally useful, not definitive.

Inside the Pi Tool

Pi presents as a clean terminal UI with no onboarding, login wall, or telemetry prompts. It's a small TypeScript codebase built around four core tools — read, write, edit, and bash — with everything else optional. It starts instantly and doesn't carry cloud-account overhead.

The model picker supports over 15 providers and hundreds of models, including local and custom OpenAI/Anthropic-compatible endpoints via a models.json file, and you can switch models mid-session without losing context. Conversations are stored as a branching tree rather than a flat log, so you can jump back before a bad turn and retry instead of dragging poisoned context forward. An extension system (plain TypeScript files), a skills folder, custom prompt commands, and an installable package system let you add complexity only when you want it. Everything also runs headless — print mode, JSON event streams, RPC, and an SDK — so the same setup works in scripts or CI.

  • Use the session tree (/tree, /fork, /clone, /compact) to recover from bad agent turns without restarting.
  • Pair Pi with cheap open models like DeepSeek for low-cost, high-volume or nightly automation tasks.
  • Start minimal and add extensions, skills, or packages only as specific needs arise.

The Payoff

Switching to a minimal-prompt harness like Pi costs nothing and, per this benchmark, can buy a real bump in task success rate alongside roughly half the per-task cost of Claude Code — meaningful savings for anyone running agentic coding tasks at volume with cheap open models.

Pros & Cons

Advantages

  • Tiny system prompt reduces token overhead and cross-model confusion
  • Outperformed Claude Code, Codex, and Open Code on task success rate in the Composio benchmark
  • Roughly half the cost per successful task compared to Claude Code
  • Supports over 15 model providers and mid-session model switching without losing context
  • Branching session tree lets you recover from bad agent turns without restarting
  • Runs headless for scripting and CI use

Limitations

  • Slower median completion time than Claude Code and Open Code in the benchmark
  • Benchmark is limited to 30 tasks from one provider, so results should be taken cautiously

Frequently asked

What is Pi and how is it different from Claude Code?

Pi is a lightweight coding agent harness built around a very small system prompt (a couple hundred tokens) versus Claude Code's much larger one, aiming to let the underlying model's raw capability drive results instead of heavy scripted instructions.

Did Pi actually beat Claude Code in testing?

In a Composio benchmark using DeepSeek V4 Flash across 30 tasks, a Pi-family harness called Oh My Pi completed 17 tasks successfully versus 16 for Claude Code, though Claude Code was faster and Open Code was cheaper per successful task.

Is Pi good for use with DeepSeek and other open models?

Yes — the creator argues Pi's minimal, model-agnostic prompt makes it especially well-suited to open models like DeepSeek that weren't specifically tuned for by other harnesses.