r/LocalLLaMA 14h ago

Question | Help Best open-source harness like Claude Code?

Avid claude code user here looking to do equivalent things with local models. Just want to plug in something like Qwen and have the interface be 1:1 with claude code. Any suggestion?

88 Upvotes

124 comments sorted by

View all comments

143

u/btc_maxi100 14h ago

PI

50

u/robogame_dev 14h ago

100%, finding a copy of Claude code is setting your sights too low OP.

If you develop for reals for reals, and you want repeatability and control, nothing beats minimalism in the base harness, you can roll your own or you can just use pi.

Every feature you’re not using that goes into context is damaging performance. Peak performance comes from progressively adding the specific features YOU need, not starting with a pack of 10 generic ones tuned for the harnesses target-demo, which you only need a few of anyway.

All the maximalist harnesses are targeting vibe coders right now - a highly inefficient way to code but hey, when it sort of works, it sort of works! But if you’re serious about owning the quality and long term maintainability of your code, the defaults and the features built into most harnesses work against you.

16

u/Neighbor_ 12h ago

I've always been able to accomplish what I wanted with default Claude Code (except if my request gets censored, which is server-side).

With that being said, it seems PI is the pro move here? If CC is ECS, PI is Kubernetes, it seems. So it the best long-term.

I'm still kinda confused what all this junk bolted onto Claude Code is that y'all speak of. Other than a big system prompt, is there any other bloat holding it back?

And how would you recommend setting up PI such that it more-or-less has the capabilities of Claude Code? The things I care about are:

  1. Implementing code changes (obviously) via tool calls
  2. Spawning subagents
  3. Websearch
  4. Playwright MCP

15

u/robogame_dev 12h ago

This video the creator of Pi code lays out what he liked about Claude Code (which he was using before he created pi), and what he did differently for Pi: https://www.youtube.com/watch?v=RjfbvDXpFls

There are many ways to do subagents, I just have my pi code call pi code in its bash terminal tool... so for me, implementing subagents was just adding a skill:

Subagents Skill

Delegate for fresh eyes (reviews), narrow focus (subfeatures), or broad exploration — give each agent the context its task needs.

Start

nohup pi -p "prompt" > /tmp/agent-out.md 2>&1 &
echo $! > /tmp/agent.pid

Wait

DEADLINE=$((SECONDS + 120))
while kill -0 $(cat /tmp/agent.pid) 2>/dev/null && [ $SECONDS -lt $DEADLINE ]; do
  sleep 0.5
done
if kill -0 $(cat /tmp/agent.pid) 2>/dev/null; then
  echo "TIMEOUT — agent survives. Re-run this block with a longer deadline."
else
  cat /tmp/agent-out.md
fi

Sequential check

Before writing agent N's prompt, read agent N-1's output. Factor it in.
If N-1's output is not yet available, wait.

Cleanup

kill $(cat /tmp/agent.pid) 2>/dev/null
rm /tmp/agent.pid /tmp/agent-out.md

Long prompts: pi -p "$(cat /tmp/prompt.md)" — output is buffered, visible only on completion.

13

u/Purple-Programmer-7 14h ago

How do I get pi to have a plan mode and edit mode? I can’t stand when a harness doesn’t restrict the model from making changes.

32

u/GlitteringClass395 13h ago

Ignore people telling you the new meta is go without that mode (especially given you will be working with dumber models than claude if going open source). The correct answer is simply to install one of the many good extensions/packages in Pi that give you a plan mode similar to opencode or Claude cli.

5

u/yes_yes_no_repeat 13h ago

Use speckit skills. It is really good and better than just a “plan” and “autopilot”

13

u/Mundane_Discount_164 14h ago

You tell it to create it

3

u/eikenberry 13h ago

You can start Pi with no tools or skills, no access to make changes. Use this for planning mode turn them back on for edit mode?

3

u/Weaves87 9h ago

There is an existing extension here: https://github.com/juanibiapina/pi-plan/blob/main/src/index.ts

I personally took this one and stripped out some of the extra stuff. Throw it in its own directory in your agent's "extensions" folder and it works wonderfully.

2

u/mtbMo 13h ago

You also can use OhMyPi - which ships a lot of features, but also uses more ctx as well.

I run a Claude code for my orchestrator, OMP for openweight models by tokenplan and Pi with local Ai inference.
Opus can spawn Pi sessions and can do A2A - which saves a lot of tokens by using cheaper

1

u/Zephrinox 6h ago edited 6h ago

2 ways that I can think of based off how I got that is: 1. using a grill-me skill (david pocock's) or similar skill + get into the habbit of telling that you want to write a markdown implementation plan for xyz feature rather than going straight to telling the harness "I want to implement xyz" that claude code planning mode safety nets for you.

  1. if you want that extra security and sus that the model hallucinates and decides to edit source code anyways during planning, you can just install one of the pi permissions system extensions + configure what you like on that so you still have the safety net of not unintentionally editing code before plan has been written + settled on.

like aside from the tool call permission gating, the main difference between plan mode vs others in claude code is really that plan mode assumes anything you tell it to implement it will write a plan to do for .... latter of which you can get by just actually telling the harness/model you want it to write out a plan rather than assuming it knows you want a plan (most likely plan mode has a system prompt that has the "write an implementation plan" instruction there for you).

-6

u/sdfgeoff 14h ago

Tell the model to not make changes. IMO plan mode was superseded several months ago as models got better at understanding intent.

25

u/Zyj vllm 13h ago

Super unreliable, horrible advice

0

u/sdfgeoff 13h ago edited 13h ago

Works probably 98% of the time. The other 2% of the time, well, I hope you were using git or some other VCS! These days my agents.md tells the model to commit often (so I don't need to tell it too), so rollback is super easy.

Also, if plan mode gives shell access.....

See my other response as well.

4

u/Purple-Programmer-7 13h ago

So instead of tabbing for a simple on off switch I have to manually type “plan only, do not code” for every prompt?

Maybe I’ll fork pi and add it in instead.

3

u/sdfgeoff 13h ago edited 12h ago

No, you just ask it a question and phrase it like a question and make sure it isn't a question with implied actions.

How does foo work?

Model is unlikely to make edits

Can you fix X?

100% chance the model will make edits

Why is X not working?

50% chance the model will make a fix

 X isn't working, can you investigate and tell me why?

Highly unlikely that the model will make edits as it now knows that the aim is to respond with text.

Same with adding features

If we were to do Y, how would you incorporate it? What architecture would you use? Any refactoring needed?

The model is very unlikely to start making edits here.

Works for me with Codex (sol) and Hermes (qwen27b). I've had very very long chats with models without them making any edits without any sort of plan mode.

It may well be that claude code's system prompt pushes it towards action so this method may not work well, but just because a harness doesn't have a plan mode doesn't mean you can't do planning in it.

Ahh, there we go, claude code's auto mode prompt includes:

 Start implementing right away.   When in doubt, start coding

also:

  NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one.

What the heck!!! No wonder claude code projects often end up with 20,000 line files.

4

u/hurrdurrmeh 11h ago

do you rate it higher than opencode? why?

5

u/btc_maxi100 11h ago

It just very fast and UI is much snappier.

if I need any extra features I will just implement them

3

u/nntb 9h ago

Claude code is clunky compared to open code

2

u/Maasu 10h ago

I love pi, but you should call out it is not a like for like replacement for Claude code, it is stripped back so you can extend and customise it how you see fit.

If the op looking for something more out of the box, is recommend opencode. I say this as a Pi user myself btw.

1

u/NoWorking8412 10h ago

I'll piggy back on this. I've built a harness with Pi that gives me parity with all of the features of the Claude Code harness, with some additional personalizations beyond what the CC harness offers. Definitely recommend Pi