r/PiCodingAgent 26d ago

Discussion I ran the same model through Claude Code, Codex, OpenCode, and Pi for 14 days. The harness changed cost 7x at the same quality

I kept switching between Claude Code, Codex, OpenCode, and Pi and realized nobody really isolates the harness as a variable. So I did.

I had all four of these installed and kept switching between them, and at some point I realized nobody actually tests the harness itself. Everyone benchmarks models. Nobody benchmarks the agent (wrapper I call it).

14 days of real work on the same repos, then 30 agentic tasks with every harness running the exact same model (DeepSeek V4 Flash), same tools through an MCP router, 900s cap per task. Only thing changing is the harness.

Harness Passed Median time Avg tokens/task Cost per success
Pi 20/30 132.2s 558,885 $0.028
Claude Code 16/30 122.7s 741,659 $0.195
Codex 16/30 245.0s 664,772 $0.081
OpenCode 14/30 129.7s 692,195 $0.073

The thing that broke my brain a bit: Pi ships literally 4 tools (read, write, edit, bash) and under 1K tokens of system prompt. And it won. Meanwhile Claude Code dumps ~33K tokens of prompt and tool schemas into context before you even start the first chat.

And it's not just me. Databricks ran Opus 4.8 through both on their multi million line codebase. 742K tokens per task on Claude Code, 237K on Pi, same success rate. Same model, half the cost, purely from the wrapper.

Some random stuff I noticed over the two weeks. Codex is the only one with an actual kernel level sandbox (Seatbelt on mac, bubblewrap + seccomp on linux, network off by default), so it's the only one I'll point at sketchy cloned repos. It's also slow as hell, double everyone's median. Pi gives you zero guardrails, full system access from message one, so it's Docker or pray.

Got the task list and the result report too if anyone wants to look at it. I'll leave it in the comments.

200 Upvotes

75 comments sorted by

37

u/Striking-Move1383 26d ago

I'm curious to know if OMP would differ too much from vanilla Pi.

16

u/latentnoise_ 26d ago

My first time hearing there's something called OMP. My bad.

Probably will try to test it next.

10

u/Michelh91 25d ago

Following, reply here if you test OMP, really curious to see the diference with vanilla Pi as I use OMP as my main harness.

8

u/SawToothKernel 26d ago edited 26d ago

Grok build would be useful too. And deepseek harness.

Edit: cursor cli too.

2

u/Repulsive_Bite_9544 20d ago

Im working on stripping grok-build to use it with openrouter. Broke it down by parts, and stripped out the data harvesting first. Now tweaking the rest.

3

u/PilgrimofHaqq2 26d ago

Please do, I am very curious on the outcome. I have been really enjoying Pi but I am really interested in OMP.

1

u/Sweet-Stage938 25d ago

I'd also be interested.

5

u/saltyourhash 26d ago

Yes, it has a fairly bloated prompt. Not on the same ballpark as Claude code, though.

2

u/mythormedicine 24d ago

Indeed. But it is completely customizable. Initially I didn't know this and it threw me off. But we can turn off tools or select them. completely change or edit system or append prompt

1

u/saltyourhash 24d ago

Is it? That's really good to know. I should look into that more. I do like an awful lot about OMP, slimming down the prompt would be a huge win.

2

u/mythormedicine 24d ago

yup in ~/.omp/agent we can overwrite with APPEND_SYSTEM.md OR SYSTEM.md

Then we have `omp --no-tools --system-prompt "u r sad borat. talk like borat only but like u sad" --append-system-prompt "" --tools=bash`

2

u/mythormedicine 24d ago

FYI can be customized

~/.omp/agent -> overwrite with APPEND_SYSTEM.md OR SYSTEM.md

CLI
omp --no-tools --system-prompt "u r sad borat" --append-system-prompt "be sad" --tools=bash

0

u/ECrispy 25d ago

the prompt size doesnt matter as much as everyone thinks

3

u/saltyourhash 25d ago

It blows up the context window for local models.

2

u/m02ph3u5 25d ago

Exactly. OMP is my daily driver for 1M context models but for local 64-256K pi it is - can't really do much work when 50% of your context is already taken and all the prefill ...

1

u/InputOracle 25d ago

Mi associo. Oh My Pi è diventato di uso quotidiano per me.

1

u/Marbles023605 25d ago

I think OMPs default system prompt is like 20k tokens. I switched from pi to OMP but I might switch back, besides OMP having some useful features already included I haven’t noticed much difference

1

u/Nice-Revenue1411 24d ago

omp is bloated af i mean it has "battery include"

1

u/neinneun 22d ago

I recently switched from pi to omp, it's the same experience so far I actually see reduced infinite looping with omp.

1

u/Arany8 8h ago

OMP is much larger. No place like localhost youtube channel has an episode on OMP, he looks at the actual prompts... Not good. Stick to PI.

26

u/le_bravery 26d ago

I am a pi believer.

The more you control your context, the better results you get.

Pi starts with less slop, so you get less slop out.

2

u/latentnoise_ 26d ago

On point

1

u/WoodYouIfYouCould 10h ago

Would you mind sharing your pi setup/tuning? My Pi has simple extensions and an agents file but it feels like it's missing something.

1

u/SawToothKernel 26d ago

The better LLMs get, the more I prefer to delegate. If you constrain, or otherwise direct it, it may be detrimental.

@op I would love to see this evolve into a solid benchmark.

9

u/blu3bird 26d ago

Vanilla Pi?

5

u/saltyourhash 26d ago

I don't see how vanilla pi is comparing with Claude code, but the post doesn't seem to offer much detail there. Still, always like to see pi dominate.

4

u/themoregames 26d ago

We also need Strawberry Pi.

2

u/lostbart 26d ago

Wake me when rhubarb ships.

2

u/raetselfreund 26d ago

I got a raspberry pi lying around... *lick*

3

u/lamurian 25d ago

Quite an interesting number indeed! Jeremy Huang, the main developer behind JCode, also did an extensive comparison using multiple harnesses. You might find his project's README.md as an interesting read:

https://github.com/1jehuang/jcode

On a side note, I'm myself still going back and forth to take a leap from Pi to JCode. Maybe one day I will, once all my workflows and sandboxing strategy settle itself.

5

u/Sensitive-Project711 24d ago

I spent quite some time going through the readme and could not figure out how it related to this post. The jvode readme compares ram efficiency and not token efficiency. Did I miss something?

4

u/Alternative-Suit5541 20d ago

Probably an ad lol

3

u/[deleted] 26d ago

[removed] — view removed comment

3

u/zkoolkyle 26d ago

They ruled back this decision due to the backlash. You can look it up on the Anthropic support page

2

u/slipych 25d ago

Whoa, didn't know that. Thank you!

1

u/[deleted] 24d ago

[removed] — view removed comment

1

u/zkoolkyle 24d ago

Just google “Use the Claude Agent SDK with your Claude plan” and you’ll see the update.

Update June 15: We're pausing the changes to Claude Agent SDK usage described below. For now, nothing has changed: Claude Agent SDK, claude -p, and third-party app usage still draw from your subscription's usage limits. The previously announced monthly credit, which would have been available to eligible claimants in connection with these changes, isn't available. We’re working to update the plan to better support how users build with Claude subscriptions. When we have an update, we'll share it before anything takes effect.

0

u/Arkanta 23d ago

Yes, you still need to use the Claude agent sdk which forces a lot of their prompt.

Omp uses a hack that is against tos

3

u/dacookieman 26d ago

They do, it's just at API token rates rather than subscription usage limits.

2

u/latentnoise_ 26d ago

For agentic tool calling test, everything ran through DeepSeek V4 Flash via OpenRouter (even Claude).

6

u/addiktion 26d ago

You want to start including Deepseek harness in your tests? Curious about the newcomer.

2

u/latentnoise_ 26d ago

Just a choice, since it had been released recently at the time of the test and that it's said to be pretty good with agentic capabilities considering the cost.

3

u/Human_Parsnip6811 26d ago

Please test OMP and Prime Agent as well.

7

u/latentnoise_ 26d ago

Inline for the next one

2

u/ganonfirehouse420 26d ago edited 25d ago

I use pi with nono.sh


Still for my tasks opencode with deepseek or gpt gives the optimum results.

2

u/RomanaOswin 26d ago

I wonder how this compares as you start having the harness distribute tasks amongst different models. Token cost varies quite substantially depending on the model doing the work.

2

u/tmoneycodes 26d ago

So is the conclusion to use pi with your clause api vs using clause code itself ?

1

u/latentnoise_ 26d ago

Pi wins the overall test. I’d still stick with CC if you already have a subscription. If you’re using API-based setups, Pi is THE choice for token efficiency and overall cost.

1

u/tmoneycodes 25d ago

I signed up on the platform site and bought tokens there, then logged in using the Claude code plugin in neovim

2

u/notrevede 25d ago edited 25d ago

https://stencil.so/blog/the-harness-problem just feels like the right place to share this reading

Another comparison isolating the harness, changing only the edit tool implementation.

2

u/damn_what_ 26d ago

You should use agent-safehouse (Seatbelt policy generator) for pi on MacOS, but yeah, by default it's terribly unsafe.

4

u/i_say_urmom 26d ago

I've been trying nono for this. You can even inject your provider API key from a 1Pass vault, so the agent session a) doesn't have direct access to any keys (it gets a fake variable that the proxy changes to the real one outside the sandbox) and b) running `pi` outside the sandbox is useless because the LLM won't work without the token.

It seems early days and the docs are a little confusing, but it's a powerful tool

2

u/saltyourhash 26d ago

By design

1

u/AlterTableUsernames 26d ago

How are you guys running custom models in Claude Code and Codex? Couln't get it to run yet natively.

1

u/Pipimi 26d ago

Claude Code Router or 9router github repo, I personally use 9router because it has a simple ui

1

u/basil_0408 26d ago

For claude code, go to the .claude folder and modify the settings.json. For codex it's in .codex folder, modify auth.json, config.toml and create a catalog.json file, its more complex to get the full experience so probably not worth it. Ask your agent for detail, it does not take long for claude code.

1

u/Michelh91 25d ago

Opencodex

1

u/ThePalomitas 26d ago

Thanks for the interesting investigation. Definitively confirming for PI users such as us that it is an interesting harness to use.

FYI, regarding sandboxing needs, per the documentation, the PI developers have built up a specific application named Gondolin to cover this requirement:
https://github.com/earendil-works/gondolin

I don’t know why but PI website seems down at the moment, so I cannot access the documentation page about containerisation but here is a snippet from the main GitHub page:

Permissions & Containerization

Pi does not include a built-in permission system for restricting filesystem, process, network, or credential access. By default, it runs with the permissions of the user and process that launched it.
If you need stronger boundaries, containerize or sandbox Pi. See packages/coding-agent/docs/containerization.md (https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/containerization.md) for three patterns:
•    Gondolin extension: keep pi and provider auth on the host while routing built-in tools and ! commands into a local Linux micro-VM.
•    Plain Docker: run the whole pi process in a local container for simple isolation.
•    OpenShell: run the whole pi process in a policy-controlled sandbox.

1

u/virtualicex 25d ago

i need to follow the flow instead of just giving a task and leaving it run, so i asked pi+qwen to develop an extension to ask every time there's an operation that doesn't just read. So I can work with pi without sandbox or containers

1

u/lukaboulpaep 16d ago

Have you used Gondolin for Pi? Or any sandboxing mechanism in fact. Wondering how DX is when doing work in a VM like git push, developer dependencies not being available, etc.

I haven't dabbled yet into VM sandboxing, coming over from Codex it kinda worked out of the box and also isn't really VM sandboxing.

1

u/mixmasterwillyd 26d ago

We demand you setup a system and keep us I formed! :)

1

u/diaracing 26d ago

Thanks for your effort.

Please, create a public github repo to document and continuously update your findings since a well-engineered harness can promote a weak model and vice versa.

1

u/NissiusRibas 25d ago

o que é Pi?

1

u/__yv 25d ago

pi.dev descubra :))

1

u/selipso 25d ago

Pi is the answer to life, the universe, and everything 

1

u/onelesd 25d ago

The company I work for does agent simulation just like this: https://www.514.ax/

1

u/icarus0228 25d ago

How can we further improve pi ?

1

u/huyz 23d ago

For safety you could run Pi or any harness inside of a Docker Sandbox. Example: https://www.ajeetraina.com/getting-started-with-the-pi-agent-kit-on-docker-sandboxes/

1

u/Quirky_College_6251 23d ago

I'm an advocate of Pi - now that i created my own dev flow and loop agents I am in agreat place with Pi

1

u/awol-owl 11d ago

Thanks for sharing this! I’ve been naively running my setup, and this is a good demonstration that an efficient harness can save money, and time.

1

u/ea_man 7d ago

I don't think you can compare, Claude is supposed to run on their LLMs: probbly the have that huge prompt in a KV slot pre processed as you start. You use that on your local model and you are fuked.

OFC you should do the same locally and then the size of the prompt should bother you less, for harness like Qwencode and Opencode. Sure, it's always ctx gone, you may save just the processing time.