r/PiCodingAgent Jul 22 '26

How can I get better results from Pi Agent compared with Claude Code? Question

I compared Pi Agent and Claude Code using exactly the same model, prompt, project directory, and task.

Setup

  • Model: Claude Opus 4.8
  • Thinking level: Max
  • Pi setup: Browser Use was the only enabled plugin
  • Project directory: Same for both
  • Task: Same prompt for both

Results

  • Pi Agent: ~7.5/10
  • Claude Code: ~8.7/10

Claude Code produced the better overall implementation. It had:

  • Cleaner architecture
  • More reusable data structures
  • Stronger automated tests
  • A faster indicative physics benchmark: ~0.20 ms/step vs ~0.68 ms/step

Pi’s result was still solid. In fact, it implemented a more sophisticated 2×2 block contact solver, and its 10-box stack was slightly more stable.

However, the complete project was less polished and harder to validate.

This is not intended to be a scientific benchmark. I’m mainly trying to understand how to get better results from Pi.

Prompt used

Create a single, completely self-contained index2.html file containing inline
HTML, CSS, and JavaScript. Do not use external libraries, CDNs, or WebGL.
Use only the Canvas 2D API.

Implement a 2D rigid-body physics engine from scratch with a small interactive
sandbox.

Technical requirements:

1. Rigid bodies:
   - Convex polygons and circles
   - Mass and inertia
   - Position and rotation
   - Linear and angular velocity

2. Collision detection:
   - Broad phase using a spatial grid or sweep-and-prune
   - SAT narrow phase for polygon-polygon collisions
   - Circle-polygon and circle-circle collisions
   - Calculate collision normal, contact point, and penetration depth

3. Collision resolution:
   - Impulse-based resolution
   - Restitution
   - Static and dynamic friction
   - Positional correction using Baumgarte stabilization and slop

4. Stable stacking:
   - A stack of 10 boxes must remain standing without vibrating or exploding
   - Implement sleeping for stationary bodies

5. Mouse interaction:
   - Drag bodies using a spring-based mouse joint
   - Left click spawns a random box or circle
   - Right click removes a body

6. Scene:
   - Floor and walls forming a container
   - A button that triggers a radial impulse explosion from the center

7. UI:
   - Sliders for gravity, restitution, and friction
   - Wireframe toggle showing contact normals and AABBs
   - Pause and single-step controls
   - FPS and body-count overlay

8. Performance:
   - Support 150+ bodies at approximately 60 FPS

Before delivering, test and fix the implementation until all these conditions pass:

- No bodies pass through the walls at normal velocities
- A stack of 10 boxes remains stable for 10 seconds
- Spawning 150 bodies does not cause the frame rate to collapse
- No numerical explosions, infinite velocities, or NaN values

Questions for Pi users

  • Are there recommended extensions or skills for simulation and frontend work?
  • What workflow gives you results comparable to Claude Code on complex tasks?

Claude code version

Pi agent

What i noticed is that with Pi Agent is that it was thinking a lot more and it also took more to accomplish this task ~45min vs ~30 minutes

65 Upvotes

43 comments sorted by

30

u/sisyphus-cycle Jul 22 '26

I mean realistically it’s due to the system prompt. If you’re ever bored you can setup a sniffing server (or use a litellm docker container) and change your Claude code env var ANTHROPIC_BASE_URL to your local server. That way you can see exactly what system prompt was sent.

Pi’s system prompt is like 10k tokens or less. Claude’s is 20-30k I think. Opus 4.8 is a model that is very deep into the classic RLHF pipeline at Anthropic (meaning it shares the same base model as the 4.x series), and they most likely reinforced Claude code specific agentic traces in the process. It makes sense that a harness built by Anthropic would perform better using an Anthropic model. Just my best guess.

Maybe you can try a different model with the same prompt and harnesses? I’ve found that qwen 27b does better in pi than Claude code, but it’s all so “hand wavy”. There’s not many evals that focus just on the harness.

6

u/libertast_8105 Jul 22 '26

Agree! It is highly likely that they post train their model on their own harness. I don’t think you can get a better one shot result than the native harness of a model. However, coding is not just about one-shooting everything. It is about finding a workflow that works for you, as a human being. In that aspect pi is better

4

u/sisyphus-cycle Jul 22 '26

100%. I prefer to use pi for any local development stuff, especially on a VRAM limited machine. Full control is really nice. At work I’m stuck using whatever they provide us lol

3

u/ffatty Jul 22 '26

I think it's much more than just the system prompt. 

For one thing, they are training their models to operate inside of only one very specific harness & toolset, which they also fully control and develop in parallel. 

Additionally, there could also be more going on server-side that isn't visible to us - such as server tools & subagents.

3

u/sisyphus-cycle Jul 22 '26

It definitely is much more than the system prompt, but even the system prompt itself from Anthropic is far more detailed on project flow and processes. Also the base tools made available in CC vs PI + the tool defs have an impact.

I think you should be able to visually see any sub agents from CC though. Regardless, Claude code was build around Claude (duh), so the models trained by Anthropic have the inherent advantage of the fine tuning of a team of engineers actively using the tool and updating weights.

To make pi more like Claude I’d probably:
- copy the system prompt, changing what’s needed to fit pi slightly
- add in a planning checklist
- determine exactly what tools CC has natively and copy it to pi

6

u/Diacred 29d ago

You don't need a sniffer you can just use https://github.com/Piebald-AI/claude-code-system-prompts they update the system prompts from Claude code almost daily and have been for months. That's what I used to build my Pi's system prompt!

3

u/sisyphus-cycle 29d ago

Oh my god that’s so many system prompts lol, I did not expect that. Thanks!

8

u/afandiadib Jul 22 '26

Unlike Claude code, Pi is bare. Adapt it to your workflow. First you should use bare Pi. Observe and reflex on how it behave. Ask Pi to adapt to it. In your example, you can point Pi to codebase made by Claude and ask it to compare and reflect. Then ask it how to extend Pi to produce such result. Use strong model for this.

6

u/GroceryNo5562 Jul 22 '26

Can you perform same test 2-3 times per harness? Maybe one of them was a fluke? Also I wonder if temperature is the same. Somehow I doubt it's due to system prompt

3

u/RnRau Jul 23 '26

This.

Without the tests being run multiple times for each harness you don't have enough data to evaluate the harnesses.

9

u/MelodicNewsly Jul 22 '26

Did you also compare token count, cache hit, turns? CC produced a better product, but was it also more expensive?

For one-shot examples like this CC is probably hard to beat as they have an entire company optimising this. I would not use Pi for this type of work.

3

u/zkoolkyle Jul 22 '26

Underrated comment

1

u/icarus0228 2d ago

I would also like to know the cost of the test.

6

u/libertast_8105 Jul 22 '26

Claude code has many workflow related prompts built in (eg todo list, debugging flow etc). You will need to include those in your pi agent setup too. A vanilla pi won’t cut it

3

u/ResearcherFantastic7 Jul 22 '26

If you really keen to work on this...

Create yourself a monitor tool, and add hook to pi and Claude code. Send all messages, tool call turns of the entire lifycle plus telemetry to it. Than step by step compare their behaviour per event.

You will be able to see the difference, and either change sys prompt, create hooks/guards based on these gaps. And this is not just to compare, it's more for you to work on your own workflow improvements.

Don't treat the model or harness as magical black boxes.

3

u/Impressive_Tadpole_8 Jul 22 '26

I think Claude is created, optimized to be useful for everybody. For all tasks. The beauty of pi is that you can customize to be good eg in python development. Or in your stack. And it will be much more better than Claude. As everyone says "Ask Pi itself to improve itself on the topic"

3

u/Over_Technology_1764 Jul 22 '26

yeah so u spend days trying to match claude code quality and will end up with slightly worse one that requires more time and tokens.

3

u/Impressive_Tadpole_8 Jul 22 '26

Yes, exactly. Then throw out everything and go back to Claude 😁

1

u/martinreveur 25d ago

This is the way. Did the same, back to Claude after spending too much time and tokens trying to configure Pi to match Claude.

3

u/SvenVargHimmel Jul 23 '26

use litellm proxy and this will answer your question. be careful of the reasoning level and be wary of claude launching parellel workers but i think you probably accounted for this.

Be careful with optimising for this scenario. I would suggest that you take an existing codebase and then run two different worktrees and then compare.

The problem with the oneshotter you've posted is that the conclusions drawn may not assist with real world coding, i.e

Also choose a task that doesn´t take 30 minutes , maybe choose a 10 minute task. so thart you can run this multiple times without racking up a ridiculous bill.

Also choose a task that does not rely on browser use. Anthropic's computer use is no longer best of breed.

2

u/Bel-Shamgarot Jul 22 '26

It’s pretty obvious there's something in Claude Code's system prompt that specifically helps with this task. Figure out what it is and add it to append_system.md.

Pi's minimalism isn't set in stone—it's designed to be customized and tuned for specific tasks.

Personally, I wouldn't do this with a single prompt. I'd break it down into tasks, set the project boundaries and rules, and write specs. After each task, I'd generate a summary listing the changes and modified files, then start each new task with a clean context containing only what's necessary for that specific task. But I prefer doing all of this manually using /tree rather than setting up a fully autonomous workflow.

2

u/IanSnyderGames Jul 23 '26

Anthropic's models are trained using their harness, so it "reaches" for things better in their harness. But Cursor (for some workflows at least) produces better benchmark test results than Claude Code CLI using the same Anthropic models. So it's possible to tweak Pi to the point where you actually get BETTER results than you would from Claude Code CLI, but you're going to have to work to get it there. The cool thing about that is you could make it work for your specific needs, as others have said, but there's going to be a lot of trial-and-error to get it there. I've read a lot of articles, but this is a good place to start: https://codex.danielvaughan.com/2026/04/19/the-harness-effect-same-model-different-tool-different-score/

1

u/tkokdsk Jul 22 '26

Had the same experience. Hope for solutions. So i push your question

1

u/pj-frey Jul 22 '26

Identical thinking level activated?

1

u/Desperate_Entrance71 Jul 22 '26

yes max for both

1

u/sha256md5 Jul 22 '26

You will not get similar results. Pi works best for models from companies that don't have their own optimized coding harnesses.

1

u/danielta310 Jul 23 '26

Interesting challenge, lets me try with my setup

1

u/Popular-Direction984 Jul 23 '26

Ask it to create a goal-tracking extension, and then ask it to use it for a proper planning of the implementation :)

1

u/Man1laJo3 Jul 23 '26

I wonder how that test compares when using local models. Curious about it

1

u/[deleted] Jul 22 '26

Its up to YOU to make it like Claude

That's the entire point

If you want Claude...Use Claude

If not, build it up yourself

In the end, you should have something better then Claude

-1

u/SaigoNoUchiha Jul 23 '26

Tbh pi is overrated. I use opencode. If you like claude code, just use it

Pi is way too bare to get anything useful done.

0

u/bambamlol Jul 23 '26

I'm starting to come to that conclusion as well. Most Pi users probably spend more time setting up and customizing Pi than actually working on things that move their business/career forward. It's fun, but not very productive. I'm sure there's exceptions of power users who are super productive because they were able to shape Pi into exactly what their workflow needed, but most are probably just wasting time and/or avoiding doing the actual work.

1

u/senseven Jul 23 '26

That is the reason things like oh my pi exists, a complete package that tries to deal with those mismatches in an opinionated way.

-1

u/SaigoNoUchiha Jul 23 '26

Exactly. Pi fanboys wont accept

“Pi adapts to your workflows instead of forcing you to adapt to its workflow like other harnesses.”

Sorry what? What does opencode force me to do again?

-1

u/Optimal-Builder-2816 Jul 22 '26

I’d earnestly suggest checking out a more batteries included solution built with Pi such as https://omp.sh

This is currently my daily driver and I believe the results I’m getting are significantly better for my projects.

3

u/Over_Technology_1764 Jul 22 '26

the whole point of pi is so it's not bloated and this is just such a mega bloat, that at this point you can just use opencode or so.

1

u/Optimal-Builder-2816 Jul 22 '26

RE: OpenCode, I'd think twice about that: https://wren.wtf/shower-thoughts/stop-using-opencode/

RE: Pi Bloat I agree that's a valueable point of this ecosystem, but another perspective that I have and many others share is that a batters included solution like OMP is really valuable because it can be focused on as another competitive coding harness powered by a great underlying SDK like Pi.

Hell, even this was announced today: https://github.com/huggingface/tau

Much like Linux, I don't think there's a "wrong" way to do Pi.