Claude Code, OpenCode, and π (pi): anatomy of a trivial request - Cdani's Blog<br>Contents
Claude Code, OpenCode, and π (pi): anatomy of a trivial request<br>Me included in Software Development Artificial Intelligence<br>May 18, 2026 2882 words<br>14 minutes
Contents
Intro<br>Anyone following the evolution of coding agents closely has probably heard about pi, the minimalist harness that became popular in part because it is one of the components behind OpenClaw.<br>One of the arguments in favor of pi’s minimalism is the contrast with the supposed “heaviness” of Claude Code, meaning an excessive use of tokens to carry out even trivial tasks. In that debate, pi and other harnesses built around the same philosophy are carving out some space.<br>Personally, I’m a happy OpenCode user, but I’m also curious and always looking for the best possible setup, so I wanted to understand this better. Since I don’t trust everything I read, I decided to verify for myself the concrete differences in the payload sent to the model for the simplest task possible: what actually gets sent to the model on the first turn as a baseline?.<br>I wasn’t trying to run a benchmark, let alone analyze the productivity impact of one agent versus another. I just wanted to look at the payload generated by the three most popular agents on a trivial task, and understand where the tokens come from, how they are spent, and whether “pi is 10x cheaper” is really true in the way people casually repeat online.<br>So I set up the simplest possible scenario: a fake project, three coding agents pointed at the same model on Bedrock through LiteLLM as a gateway, and a single prompt:<br>just say “hello”, nothing else
I then captured the full request, the response, and the metadata at the highest verbosity level for each harness. The numbers alone are already interesting. The shape of the payloads is even more interesting, and worth discussing.<br>The conclusion I came away with is this: raw input token count is not a meaningful benchmark , especially when you compare harnesses in their “plain-vanilla” form, without customizations, skills, tools, or integration with each ecosystem.<br>What really matters is the mix of tools the harness exposes, the steering it embeds into tool descriptions, and how effectively it takes advantage of model and provider features such as prompt caching. Pi is genuinely cheap on a single interaction. It is also the only one that, because of an AWS API constraint, silently skipped prompt caching, and the only one that sends effectively zero guardrails inside its tools — two choices most teams will have to think through before using it with a team and on a real project.<br>The setup<br>The fake project is simply a folder containing this AGENTS.md:
This is an example project to make some experiment with coding agents. Key tech stack:<br>- python (uv)<br>- shell (zsh)<br>- aws cli
All three agents were configured to talk to the same model — eu.anthropic.claude-haiku-4-5-20251001-v1:0 on Bedrock — through a LiteLLM proxy with full request and response logging. So: same model, same provider, same tokenizer, same caching backend. The only thing that changes is the harness itself.<br>Another important detail: for all three harnesses I removed any MCP tool, skill, prompt, or additional agent. So we’re looking at their “out-of-the-box” configuration.<br>The flow looks like this:
flowchart LR<br>subgraph CLI["Coding agent (CLI)"]<br>H[Harness:<br>system prompt + tools + steering]<br>end<br>H -->|OpenAI-style request| G[LiteLLM Gateway]<br>G -->|converse API| B[AWS Bedrock]<br>B --> M[Claude Haiku 4.5]<br>M --> B --> G --> H<br>G -.->|verbose log:<br>request / response / metadata| L[(JSON files)]
For each agent I saved three artifacts:<br>request.json — the full body sent to the model (system, tools, messages, caching hints)<br>response.json — what came back<br>metadata.json — LiteLLM’s view of usage and costs<br>You can download the sanitized payloads below if you want to inspect them yourself:<br>Claude Code — request · response · metadata<br>OpenCode — request · response · metadata<br>pi — request · response · metadata<br>The numbers that jump out immediately<br>Here is what each harness actually sent for that single “hello” turn:<br>HarnessToolInput tokenToken cache-creationToken cache-readFirst-turn cost (USD)Claude Code2728.40728.4040$0,0391OpenCode1212.37412.3710$0,0170pi52.76800$0,0031So pi is roughly 10 times cheaper than Claude Code on a cold “hello”, and Claude Code is 2.3x more expensive than OpenCode . If we stopped here, the conclusion would write itself: pi wins, OpenCode is the right compromise, Claude Code is the bloated one. That’s more or less consistent with what I’ve been reading around.<br>The problem is that the first cold turn is not the regime in which these agents normally operate.<br>Why the “cheap on paper” number is misleading<br>Anthropic prompt caching on Bedrock applies a 1.25x...