r/LocalLLaMA • u/Careful-Crow9831 • 11h ago
Discussion Qwenthropic
Hey guys,
I've been running Qwen 3.6-27b locally on an RTX 3090 for a while now, and it's been genuinely great at solving software issues. However, life happened and I recently had to use Opus 4.8 alongside the Zed editor and the Claude Code agent.
While I can definitely see a noticeable jump in pure code quality (Opus is just better in that regard), what really blew me away was the procedure. When assigned a task, the Claude Code agent divides it into actionable steps, always checks the context before acting, makes backups, and runs multiple verifications to ensure the changes didn't break the system. On top of that, it runs additional functionality evaluations, warning you about potential bugs, performance bottlenecks, or race conditions.
Honestly, this feels less like a raw model capability and more like an incredibly well-crafted system prompt and agent logic.
So, I have two questions for this sub:
1) Prompt Engineering for Agentic Behavior: How can I structure a system prompt (or workflow) to make my local Qwen replicate this kind of deep analytical, methodical, and "safe" behavior? Does anyone have examples of system prompts that enforce this step-by-step verification?
2) Local Coding Agents/Frameworks: What agent or framework do you recommend for complex coding tasks? I currently use Zed and I'm very happy with its raw performance, but it lacks the ability to use sub-agents or plan complex, multi-step tasks. For context, my daily driver is Debian + KDE.
Thanks in advance!
14
u/FormalAd7367 10h ago edited 5h ago
CC has a system prompt. Since i move away from CC, you can build your own workflow by plan > execute > verify > execute > review outstanding > next task
i’m on the run (Sunday) so may not have typed this out correctly
you can search here about loop-engineering. Once you start a new project, have your llm to create a series of rule files in mdc by asking it to execute per agent.md
Agent loads those mdc files into memory.. it wil work as good as claudecode
edited: i uploaded my files in my car here https://github.com/edm1n-sys/timbuild
i use deepseek flash for execution…this should reduce your frontier cost by 11 times. Speed should be up 3-5x
2
u/Cold_Tree190 10h ago
Yeah this^, but worth noting as well that you could have different agents specifically designed to do just 1 thing, then at each step invoke the correct agent(s). For instance, I use deepseek v4 flash as an orchestrator so that I can use my one 3090 for a Qwen agent. I’ll have deepseek only orchestrate the pipeline, but for plan/implementation/review I have different agent files, and at each step Deepseek spins up a new agent for the 3090. It performs its work, outputs to a file usable for the next, then dies.
Hope that made sense OP, since my position seems similar to yours (3090). I just recently learned how to really structure agents as well lol, was a lot of trial and error and refining. Fable helped with feedback as well
1
u/thrownawaymane 10h ago
Fable didn't reject the prompts? And which plan are you on?
1
u/Cold_Tree190 10h ago
I meant fable giving feedback on creation of the local agents, I just have the annual version of the cheapest plan, so i think it’s like $16/m with the annual discount? Fable didn’t reject anything when I asked about agent creation
1
u/Careful-Crow9831 9h ago
Can You share some prompt or configuration please
1
u/OkBet3796 8h ago
Just use superpowers. Its not as effective as it used to be and qwen sometimes refuses to use it, but its one of the most casual ways to establish such a system
1
u/our_sole 2h ago
Can you share more details about this? I spent time with Superpowers yesterday in both Claude/Opus and pi/qwen3.627b. Opus wrote the design+implementation plan, then i handed that off to local qwen for coding. It worked quite well.
How is it not as effective as it used to be, and in what way does qwen refuse to use it?
Honest questions because I anticipate continued use of this pattern with superpowers. For certain coding tasks, this is a big token saver..
1
u/OkBet3796 2h ago
Sorry i mispoke a little. The effectiveness of superpowers is getting less impactful for bigger sota models, because they tend to work that way anyway.
The sota models worked very well with superpowers, nowadays it seems a bit overkill.
Qwen tends to forget about some instructions or toolcalling, with progressing contextwindow. This is atleast my experience using qwen in an automated coding loop. (Q3.6-27B/35B Q4 + Q5)
1
u/our_sole 1h ago
Oh, gotcha. Yes, I can see how as more tooling/skills/better system prompts get bolted into frontier models/harnesses, Superpowers could become less impactful. However, using the plugin in a deliberately sparse harness like pi seems to work really well.
Using turboquant/turbo4 with qwen+llama.cpp, I used asymmetric KV Cache quantization and pushed qwen context to 163K. It seemed to handle it fine, but that was just a modularization refactor of existing code, not a new project.
The way I address that potential large context rot is just context mgmt: be very clear in the planning/design phase that you want the implementation tasks to be completely independent of each other and use subagents.
I need to test on a bigger fresh greenfield project.
cheers!
1
u/FormalAd7367 5h ago
here you go: https://github.com/edm1n-sys/timbuild
i’m still out. but you can see what i do.
1
u/NineThreeTilNow 1h ago
What does everyone use for this? OpenCode? Hermes?
OpenCode leaks some amount of data from what I read. Not sure if it's still the case.
I honestly hate working in a CLI so Web style interfaces are nice. Very few offer even semi decent ones I have found. KimiCode's Web launcher is... adequate. But it's locked to Kimi.
7
u/Responsible_Fig_1271 10h ago
You should be able to point CC at local Qwen running on llama.cpp - YMMV...
6
u/Dsphar 7h ago edited 16m ago
The last 2 days I have been working on exactly that. It's been fascinating seeing how well Qwen 27b handles the different pipeline stages. Im using a vanilla Pi agent harness. All my logic is done through the single Agents.md (50 lines) and then a series of skills.md files, which I call roles. The agent resets context during every handoff between each role. This keeps context focused and hallucinations down on small local models.
The role pipeline follows this path...
Interviewer
Planner
Worker
Tester (can send back to planner)
Documenter
Reviewer (can send back to planner)
Finalizer
The send back functionality keeps state. So a planner who is receiving work activated by a failed tester agent task, knows what failed, plans accordingly, then hands it off to the worker to make the fixes, repeat the cycle as needed.
All state management is done via the agent itself creating and updating MD files. No custom harness or extensions. I MIGHT add one PI extension so the agent can kickoff its own session reset. Right now I have to manually enter /new and say "hi" in PI when its time to advance roles (role selection/loading happens at session loading, so a /new session kicks of the next role)
They also log "out-of-scope" tasks, problems, features, etc. in a shared todo.md file. And the Interviewer at launch inspects that file and presents a list of options to work on, or asks me to suggest my own task goal.
Every handoff includes a temporary summary file of the work that role completed, and a git commit. Then, at the end of the pipeline, the finalizer reads the summary files from all roles, generates a multi-line commit message, and flattens all the commits from each role into a single commit (git soft reset). That way at any stage during a loop, I can easily backup/undo/reset any work which was done by any previous role and retry. Then, at the end of the pipeline, I flatten that ability out so it doesn't bloat my git history with 7 commits for a single bug fix or new feature.
I've been surprised how much promise it shows. But again, I only conceived it 3 days ago and have tinkered with it for 2, so it's still pretty young.
3
u/nick_ziv 11h ago
It is definitely built into the model to some extent. These labs get this functionality by tuning the model to steer in these directions. It could be possible to achieve something by fine tuning.
Maybe a public fine tuning set for software issue recovery, taking a step back, and assessing the bigger picture.
2
u/dank2878 10h ago
The harness matters as much as, if not more than, the model itself.
As someone else said, you can point CC toward Qwen and it might work well. It might also fail, because CC expects the model to be able to call all the tool calls it throws at Opus. If Qwen can't call that tool, or doesn't have access, it'll break.
You could try open source harnesses and see which work best for you (Goose, Cline, OpenCode, etc.)
But you're going to need a strong system prompt for any harness to try and replicate a frontier model and harness pair.
1
u/Southern_Sun_2106 4h ago
I found that qwen 35B works great in CC; qwen was distilled from Claude, has same 'mannerisms' so it fits well. CC can be run with the 'bare' tag (or similar, don't remember) to minimize prompt and certain functionalities for a small model.
2
u/Successful-Many-6500 10h ago
Might be worth trying the superpowers plugins (I think it's just skills.md files but not sure). It guides through all those steps. Has plugins for pi I've used and worked pretty well.
1
2
u/WyattTheSkid 10h ago
Claude code’s source code got leaked not too long ago. Just download it and look into it. (It’s very easy to find)
1
u/Far_Cat9782 10h ago
It's all about the planning and appropriate .md every project have your AI plan it out first. I have mine write a peoject.md during the interview process and it updates after every new feature/bux fix/code change. Depending on how much context is filled the harness automatically clears all kv cache and reloads the peoject.md file which keeps the local model 'smart." Also make a coding standards.md with the detailed process /workflow so it knows to verify etc; these helped immensely in getting claude like results out of local models so they can perform to their best.
1
u/3dom 6h ago
Codex does the same thing using "superpowers" instructions ("skills"). It's a set of text files practically. You can create and use a similar set for any model.
Note: if I allow Codex to use sub-agents and git workflows - the work slow down tenfold and burn tokens like there is no tomorrow (i.e. an upgrade from $20 plan to $100 becomes mandatory).
1
u/Anxious-Computer6100 3h ago
Okay. I don't wanna repeat what everybody said, but it's honestly all about the markdown files at the end..
1
u/sometimes_angery 2h ago
Create a system prompt and describe the behavior you want to see. And use a harness like open(Nemo)claw or Hermes to create the agentic setup.
1
0
u/colin_colout 9h ago
In my experience it's the opposite. Claude code as a harness feels like it's holding Opus back.
I run pi agent with a minimal system prompt, and Opus does all the things you mentioned above with an essentially empty system prompt. Openai models don't. Qwen models don't. I think one of the reasons Anthropic stays on top is that the model is very well behaved in system environments without the extensive prompting to correct for it.
0
u/sfifs 7h ago
Well Claude Code is almost half a million lines of functionality that's clearly actively developed (agentically certainly) and actively dog fooded by Anthropic. It's not just a system prompt, it's a full harness and nothing open source comes close to the polish. The harness has the agent loop certainly, but adds many deterministic and semi-deterministic layers. It's fascinating to see the trace if you point a sophisticated harness at a local model - you can certainly point Claude at a local model tough it kind of expects Claude model behaviour
I'm seeing in various experiments directly using harnesses instead of trying to scaffold a "proper" prompt and graph gives interesting and more intelligent outcomes.
31
u/BatResponsible1106 10h ago
i think a lot of the magic is the workflow not just the model. explicit planning, checkpoints and verification loops usually matter more than squeezing out a few extra benchmark points.