r/PiCodingAgent • • 21d ago

Plugin One Code: a pi package that adds almost all Claude Code's features (plan mode, subagents, auto mode, hooks, MCP) to pi

I've been building One Code, a pi package that brings the Claude Code workflow to pi. If you already run pi:

pi install npm:one-code-extension

It's 53 extensions, no fork and no patches to pi, just the normal extension API. Tested on pi 1.0.0 through 1.5.

What you get: plan mode, permission modes including auto mode (a classifier decides which commands need your approval), subagents that can each run on a different provider, git worktrees, hooks, skills, slash commands, MCP, plugins, background shells, memory and compaction. It also reads an existing CLAUDE.md and .claude folder as is, so if you're coming from Claude Code your setup carries over.

There are already good pi extensions for some of these, like subagents, and you can put together a decent setup from a collection of them. The catch is that any one of them can break the prompt cache if it rewrites earlier parts of the conversation, and they don't know about each other. So in One Code I tried to make the extensions work as one system, and keeping the cache stable was a big part of that. Every request is recorded as it was sent, and later requests only append to it, so cache reads stay high across resume, fork and reload.

There's also a bundled app with pi pinned inside, if you'd rather keep it separate from your own pi setup.

npm i -g @one-ai/one-code

MIT licensed. Repo: https://github.com/IsuruMaduranga/one-code

Feedback from people who know pi's internals is very welcome.

If One Code is useful to you, a ⭐ on GitHub helps other people find it.

65 Upvotes

32 comments sorted by

5

u/kelvie 21d ago

MCP is already in pi though?

1

u/the_qubit 18d ago

Yeah we needed a different extension to support Claude code hooks. Pi converts hyphens to underscores. Ours preserves them so existing permission rules and hooks still match. But I hope to reuse Pi MCP in a future release

2

u/kantorcodes1 19d ago

When auto mode decides whether to ask for approval, does it classify the full command and its arguments or a shorter summary?

1

u/the_qubit 18d ago

Full transcript. Exactly as Claude code

1

u/kantorcodes1 12d ago

Got it. Keeping the full command and argument transcript gives the classifier the context it needs, while still letting the approval rule preserve the exact strings it will execute. That should also make a replay or audit easier when a command is resumed.

2

u/bit_shifting_is_sexy 21d ago

Why? Just use claude code if you like it so much

14

u/MotokoAGI 21d ago

Shaddup, claude code still sends some of your prompts to Anthropic when you run it locally. Some of the functionality are not available unless you subscribe through them. For example, decision making/smart auto approval they have, or /remote-control

13

u/[deleted] 21d ago

Nope. I like mixing models for different tasks and different workflows.

Like a subagent of one provider + an orchestrator of one provider + my owm choice of model for my own harness' auto mode classifier.

-1

u/Abject-Kitchen3198 21d ago

Reminds me of grilled sausages imitating meat. I was a vegan for quite a while. I never craved meat taste or texture.

1

u/kasdlkmad 21d ago

we are not talking about imitating quirks and useless stuff, those are useful harness tools. basically you have all claude code's features (the harness most people used first) + all the features from Pi, like the extensions, patches, different providers... hell the guy literally mention his use case with different providers and models and you guys are still bitching about "just use claude code".

0

u/Abject-Kitchen3198 21d ago

Just use Claude Code (or Pi)

0

u/[deleted] 21d ago

[deleted] — view deleted comment

4

u/bit_shifting_is_sexy 21d ago

You use Pi to escape Claude Code's bloat. Its very intentionally designed to work with just few tools. Sure go ahead add 53 extensions all at once, whatever floats your boat!

4

u/kasdlkmad 21d ago

"hurr but you use pi to escape claude code's bloat"

meanwhile in the official Pi website:

"Pi is a minimal agent harness. Adapt Pi to your workflows, not the other way around. Customize Pi with extensions, skills, prompt templates, and themes. Bundle them as Pi packages and share via npm or git.

Pi ships with powerful defaults but skips features like sub-agents and plan mode. Ask Pi to build what you want, or install a package that does it your way."

it literally TELLS you to extend it instead of using it as it is. the whole point of Pi is extending it as much as you want, NOTHING to do with bloat nor to "hurr but its designed to work with just a few tools".

1

u/[deleted] 21d ago

No harness is "designed to work with just a few tools". Pi gives you a bare-minimum. That's not a limitation. That's just a reliable ENGINE behind, you can build your own on top of it.

0

u/[deleted] 21d ago

[deleted] — view deleted comment

-5

u/bit_shifting_is_sexy 21d ago

lol sure You can eat with your hands.. or your foot. Both works!

3

u/Even_Nebula_2730 21d ago edited 21d ago

just stop being an asshole, what can't you understand about people liking the way claude works and combining that with the whole customization they can do on pi?

I doubt that in your head, your "hurr just use claude" makes any sense, you just want to bitch.

2

u/kasdlkmad 21d ago

well you can think with your head... or your ass. it's clear which one you used.

1

u/tulwio 21d ago

You are such a weirdo

1

u/kasdlkmad 21d ago

no way people are downvoting this wtf how is this guy wrong??

the point of Pi is literally to offer you a bare-minimum harness for you to do whatever you want

if someone want to make it claude code? sure, THEY CAN, then it would have all claude code features PLUS Pi whole harness to customize AND different providers.

7

u/Ideabile 21d ago

Cool! Do you have an estimate what is the token usage vs how effective does the task / quality of work on comparable models?

1

u/MuzafferMahi 19d ago

I tried this, but qwen 3.8 flash next failed 5 tool calls in a row (usually it never does) and got stuck on random stuff. I really wanted this to work :/ Good job tho!

1

u/the_qubit 18d ago

I just tested with qwen 3.8 flash with openrouter and it works perfectly. If there are any issues please create an issue in the repo.

1

u/MuzafferMahi 18d ago

tbh I use the gyro S quant locally, which does brain damage so I'll take the L. But it works fine in opencode/pi. This is not a strong agent so thats on me :d

1

u/the_qubit 17d ago

If it works with OpenCode it should work here too. Can you create a git issue with the details? I will fix it for you.

1

u/supercachai 18d ago

How many tokens does it insert into the sys prompt?

0

u/the_qubit 18d ago

Dependes on the model

1

u/ayongpm 18d ago

53 extension in one? Maintaining them all would be hard I'd imagine. Still, good job! Compiling pi using `pi-bolt` might be the way I believe to get the best performance of this big setup.

1

u/the_qubit 18d ago edited 18d ago

Yeah you need all of them to be coherant to keep a stable prefix cache. Thank you for the suggestion I will compile it with pi-bolt

3

u/OneMoreName1 19d ago

This is cool, I was trying to do something similar myself but lost interest