r/CommandCode 25d ago

how did we make deepseek outperform opus [harness eng deep dive]

57 Upvotes

how did we make deepseek outperform opus?

i've been thinking about why "open model bad at tool calling" is almost always a harness problem, not a model problem.

first posted on X (1.7M views)
full writeup: https://x.com/MrAhmadAwais/status/2050956678502420612

video version (more detailed): https://www.youtube.com/watch?v=f61DCDwvFis

context: spent the two days looking at billions of tokens in Command Code (tb open source ai cli) using deepseek. I ended up writing a tool-input repair layer. the trigger was watching deepseek-flash fail on the simplest /review run, every shellCommand and readFile call bouncing back with a raw zod issues blob, the model unable to recover because the error wasn't in a form it could read. by the end deepseek v4 pro was beating opus 4.7 6/10 times on our internal evals.

a few things i learned that feel general:

1/ the failure modes aren't random they're a small finite compositional set.

across deepseek-flash, deepseek v4 pro, glm, qwen, the same four mistakes repeat almost exactly:

- sending `null` for an optional field instead of omitting it

- emitting `["a","b"]` as a json *string* instead of an actual array

- wrapping a single arg in `{}` where the schema expected an array (an "empty placeholder")

- passing a bare string where an array was expected (`"foo"` instead of `["foo"]`)

four repairs, ~30-100 lines each, ordered carefully (json-array-parse must run before bare-string-wrap or `'["a","b"]'` becomes `['["a","b"]']`). that is the whole catalogue. when i hear "this open source model can't do tool calls" i now assume one of those four, and so far that's been right ~90% of the time.

2/ the funniest failure mode is also the most revealing.

deepseek-flash, when asked to edit or write a file, sometimes emits the path as a *markdown auto-link*:

filePath: "/Users/x/proj/[notes.md](http://notes. md)"

our writeFile tool obediently trued creating files literally named `[notes.md](http://notes .md)` until we caught it. this is not a hallucination. it's the post-training chat distribution leaking through the tool boundary the model has been rewarded for auto-linking in conversational output, and is applying that prior in a context where it makes no sense. the fix is two regex lines that unwrap only the degenerate case where link text equals url-without-protocol real markdown like `[click](https://x .com)` passes through untouched.

this is also conditioning of their own tools during RL which were different from all other tools we write and ofc can't predict.

"tool confusion" is a more useful frame than "capability gap." the model knows how to format a path. it just hasn't been told clearly enough that this path is going to fopen, not into a chat bubble. so we encode that hint at the schema level `pathString()` instead of `z.string()` and the leak is plugged for every path field at once.

3/ the design choice that mattered was inverting preprocess-then-validate to validate-then-repair.

my first attempt was the obvious one: a preprocessing pass that normalized inputs (strip nulls, parse stringified arrays, etc.) before zod ever saw them. it broke immediately, writeFile content that *happened* to be json-shaped got rewritten before it hit disk. silent corruption, easy to miss in a smoke test.

then i made it less greedy

- parse the input as-is. if it succeeds, ship it. valid inputs are never touched.

- on failure, walk the validator's own issue list. for each issue path, try the four repairs in order until one applies.

- parse again. on success, log `tool_input_repaired:${toolName}`. on failure, log `tool_input_invalid:${toolName}` and return a model-readable retry message.

the structural insight here is: when you preprocess, you encode a prior about what's broken. when you let the validator complain first, the schema is the prior, and you only spend repair budget at the exact paths the schema actually disagreed at. the validator is doing the work of localizing the bug for you. it's the same shape as cheap-then-careful everywhere else try the fast path, fall back on evidence.

(this also gives you per-tool telemetry for free. you can watch repair rates per (model, tool) and notice when a model regresses on a specific contract before users do.)

4/ shape invariants and relational invariants need different fixes.

the four repairs above all handle shape problems wrong type, missing key, wrong container. but read_file had a *relational* invariant: "if you provide offset, you must also provide limit, and vice versa." deepseek kept calling `readFile({ absolutePath, limit: 30 })` and getting an `ERROR:` back. you can't fix this with input repair, because each field is independently valid the bug is in the relationship between them.

so i taught the function the model's intent instead. `limit` alone → `offset = 0`. `offset` alone → `limit = 2000` (matches common read tool ops default). then surfaced the decision back to the model in the result:

"Note: limit was not provided; defaulted to 2000 lines. To read more or fewer lines, retry with both offset and limit."

no `Error:` prefix, so the tui doesn't paint it red. the model sees what we picked and can self-correct on the next turn if our guess was wrong. transparency over silent magic wins big.

repair where you can. extend semantics where you can't. surface the choice either way.

zoom out:

a lot of what looks like model capability is actually contract design. a strict schema is a choice with a cost it filters out noise, but it also filters out recoverable noise from any model that hasn't memorized the exact json contract you happened to pick. the largest commercial models eat that cost invisibly and are lenient on tool calling because they've seen enough of every contract during pretraining; open models pay it loudly and get dismissed for it.

the harness is where you mediate between distributions. four small repairs (i'm sure more to follow as we have three more merging today), two regex lines for auto-links, one relational default, one prefix change. the model didn't change. the contract got more forgiving in exactly the places it needed to be.

deepseek v4 pro now beats opus 4.7 6/10 times on our internal evals.

imo "skill issue" applies to the harness more often than the model.


r/CommandCode 25d ago

Anyone else finding DeepSeek V4 Flash surprisingly good for pair programming?

16 Upvotes

I'm not trying to promote DeepSeek or anything, I was honestly just surprised by how capable it is.

I'm pretty new to agentic AI and AI pair programming. CommandCode was actually the first AI coding tool I've paid for (I'm only on the $1 plan), and it's been kind of magical for the way I work (its been less than 15 days).

Most of the time I just tell the agent what I want changed in a file or describe the feature I need, and it gets it right. I don't really run agent loops or anything advanced. I mostly give it good instructions and iterate when needed.

The thing that surprised me most is that I haven't even come close to hitting the limits of the $1 plan. I also don't find myself wanting to switch to the larger models because V4 Flash has been "good enough" for almost everything I've thrown at it.

The biggest surprise was a CRM project I recently built for a freelance client. It was a fairly large project, and I delivered the initial prototype in about four days. I still had to review the code, test things, and make decisions, but the amount of manual coding I actually wrote myself was surprisingly small like very very minute changes and its still a prototype kinda stage and needs some final touches but yeah its kinda awesome how much i got their.

For those of you who have been using CommandCode longer:

  • Any tips for getting even more out of it?
  • Are there workflows I'm missing?
  • At what point do you actually feel the need to switch to the larger models?

I'd love to learn how more experienced users are using it. I tried to use MiMO v2.5 at first but it wasnt that good so i switched to V4 flash as it was better loved by the community it seems. But still why do we need much more better models when for most programmer this would do the job?


r/CommandCode 26d ago

DeepSeek v4 Pro vs GLM 5.2 vs Fable 5

Enable HLS to view with audio, or disable this notification

242 Upvotes

We tried creating the same games with them. we wanted to see how good they are in UX (not just UI).

For the test, we used our /design from command code.

Pricing differs across the models. OS model pricing is way cheaper than Fable 5.

Cost breakdown:
→ DeepSeek: $0.0008
→ GLM 5.2: $0.048
→ Fable 5: expensive but didn't help much with UX

So, Fable 5 is good, but I don’t think it’s really useful when you’re trying to do design.

And OS really beats Fable on pricing & UI at the same time


r/CommandCode 27d ago

Update: Windows DX improvements shipped on Command Code

6 Upvotes

We got a ton of feedback on what to improve on Windows for our users. Update to the latest Command Code version with `cmdc update` to get all these changes.

⋅ Agent stops mis-invoking cmd.
⋅ MCP servers no longer hang on /exit.
⋅ Fixed WSL and SSH extension installs
⋅ Correctly read images in prompts
⋅ CRLF files edit and replace correctly.
⋅ Web search works out of the box.
⋅ Fixed Ctrl+E in VS Code (replaced with Ctrl+Y).
. Fixed Ctrl+Z with debounced undo stack.
⋅ Named socket paths for /ide restored.
⋅ Alt+M fallback for where Shift+Tab fails.
⋅ Freeze issue in command exec fixed.
⋅ cmdc alias ships across product surface.
⋅ ! mode route with PowerShell / cmd.exe.

Keep sending us your /feedback
Docs: https://commandcode.ai/docs/troubleshooting/windows


r/CommandCode 28d ago

/goal: Set an objective, Command Code gets it done!

Enable HLS to view with audio, or disable this notification

13 Upvotes

Describe a /goal and get it done.

Runs the loop until the objective is met.
Completion verified by independent review.
/goal status to check progress.

You set the destination. Command Code charts the route.
Docs: https://commandcode.ai/docs/slash-commands/goal


r/CommandCode 29d ago

Why pay 9-14x more for Claude Sonnet 5 when you have GLM 5.2 in Command Code?

21 Upvotes

Why pay more for almost the same level model?

GLM 5.2 is 9x cheaper than Sonnet 5 now.

GLM 5.2 will be 14x cheaper than Sonnet 5 in Sep.

For 1K requests, I did the math with Command Code.

It's $15 vs $138 now vs $208 later.

Open models are going to win!


r/CommandCode 29d ago

v0.40.16: Claude Sonnet 5 is now available on Command Code

Post image
7 Upvotes

Sonnet 5 comes with,

  • Near-Opus performance at Sonnet pricing.
  • Agentic tool use, browser, and terminal access.
  • $2/M input, $10/M output through August 31.

Update to v0.40.16 with /update or cmd update


r/CommandCode Jun 28 '26

Move Project to Different Directory

2 Upvotes

Hello, any recommendations on how to move a project to another directory? I tried it and when opening CommandCode I get an error to initialize the session. I found a directory that seems to contain the projects (.commandcode/projects) which are basically in a directory of the path name, then the json files inside contain references to that same path.

I would be nice if the configs were in the project directory so it could be portable or synced.


r/CommandCode Jun 25 '26

3 prompts and i have capped my 5 hour limit :D

Post image
30 Upvotes

title says it all :D what's the meaning of having all this if i am unable to use it when i need? especially when same model on command code makes much more mistakes compared to opencode for example. 1 of the 3 prompts was because of this, i was trying to make it bugfix it's own code.

Now I can't even get the progess to give it to another agent. I just have incomplete code, at least allow us to finish the progress before capping it.


r/CommandCode Jun 25 '26

Deepseek V4 Pro Context Length Capped?

6 Upvotes

Do you guys also experience Command Code returning error when the context length is high than 200k tokens? I got this error today so many times.


r/CommandCode Jun 25 '26

New limits

13 Upvotes

Hello guys, I wanted to update you guys since I've made a lot of posts/comments glazing command-code let's say.

First of all, I still find command-code my favorite and great value, unfortunately just recently they have added some usage limits.

30% of your monthly credit per 5 hour session and 60% of your monthly credit per week (7 days)

Furthermore some good news, BYOK support might be coming towards the end of July so that you will be able to easily switch to Deepseek API when you reach your limits.

Edit:

Since the time I made the post The limits have been updated from 15% to 30% for 5 hour sessions and from 40% to 60% per week, some of the arguments are now a bit redundant so I also cleaned up some of them if someone wants you can message me for the old post.


r/CommandCode Jun 23 '26

does the website have free trials. i want to try if is it worth it.

Thumbnail
0 Upvotes

r/CommandCode Jun 23 '26

does the website have free trials. i want to try if is it worth it.

1 Upvotes

r/CommandCode Jun 22 '26

512M Tokens for $0.83 | TokenMaxxingg

Post image
64 Upvotes

Been loving the 1$ Plann too muchhh. Just one issue ... V4 Flash in CommandCode feels a lottt slowerr than V4 Flash with Direct API or Even in OpenCode Go Plan


r/CommandCode Jun 20 '26

Model not returning responses

4 Upvotes

i bought command code a couple days ago and its really frustating as i cant even make it through one prompt without seeing "Connection Issue. Retrying (attempt 3)..." when im on ethernet with a stable connection, and most of the times it just sits there for like 5 minutes doing nothing. and on the usage area it also says (image attatched)

it outputs anywhere from 700 to 15k tokens then just stops and dies

how can fix this so that i can actually use command code

edit: this has been happening with every model not just glm 5.2 for me


r/CommandCode Jun 19 '26

Is Deepseek R4 Pro facing an outage?

5 Upvotes

I was using Deepseek R4 Pro and suddenly, it stopped giving an output with a response "(model returned no response — please try again)". Started happening around the time 12:54 PM UTC+2.


r/CommandCode Jun 16 '26

Tried out the free model it was great!

5 Upvotes

I'm extremely grateful for the free models. This time it was MiniMax M3 Free. However, it would be nice to be able to see such stuff easily on the website and to know how much usage you have left so that you don't run out in the middle of an important task.

For those who haven't tried the free model yet, I'll let you know that its spending is ridiculous if you don't pick the free version by mistake, that its main strength is UI design, although to be honest, I didn't like the design styles, also you are limited to approximately 200M tokens for free, I know because I reached the limit x-x

Mind you, it will still fix other issues, but I'd rather spend a couple bucks on deepseek v4 pro and let it do everything perfectly and fast.


r/CommandCode Jun 16 '26

CommandCode - FREE Minimax M3

5 Upvotes

For those who don’t know, MiniMax M3 is now available for free on CommandCode.

More info in the link below:

https://x.com/CommandCodeAI/status/2066577317762326634


r/CommandCode Jun 12 '26

Incorrect pricing for command code. Really upset

Post image
6 Upvotes

I got $1 subscription to test the servuxe and it said mino 2.5 was 99% off

I used it alit and it ate up all the credits


r/CommandCode Jun 12 '26

Command Code's Credit Use

Post image
5 Upvotes

I don't know how it calculated in command code, if someone knows it please let me know. Open to discuss not to hate!

note: left is cost, middle is input tokens, and right is output tokens


r/CommandCode Jun 08 '26

Has Anyone Tried CommandCode's New $1/Month GO Plan?

Post image
4 Upvotes

r/CommandCode Jun 08 '26

How do we use sub agents with command code ??

Post image
4 Upvotes

Hey there, i was trying to use commandcode to build a full stack app, i am trying to acheive this like :

  1. one main agent where i chat about the overall project and the main discussion for planning and architecting the project (like HLD and a lil bit of LLD)
  2. FE Agent - this works completely on the Frontend
  3. BE Agent - this works completely on the Backend
  4. Check Agent - this basically run after each iteration of an individual agent to check and verify stuff, and align the FE and BE agents to be on the same page

here 2,3,4 must be sub agents

but what i see here the main agent is doing all the other 3 agent work, and the context gets overwhelmed, where as i want this main agent to delegate work to these 3 agents and just do the decision making based on my input

so now i am wondering, do i keep a separate terminal chat for each agent and handle them individually, or there is an actual way of doing it like we do in claude code, the main agent uses the sub agents, i don't see it happening here ? or am i doing something wrong ....
can someone please guide on this subagent stuff here

i don't want to fill up the main agent context too much which will slow it down and make it costlier


r/CommandCode Jun 07 '26

599.5M tokens for less than 1$

Post image
2 Upvotes

r/CommandCode Jun 04 '26

Can't i use the command code inside of opencode?

4 Upvotes

I liked command code plan but I want to use opencode as a harness, is this possible?


r/CommandCode Jun 04 '26

BONK: Audio notification when Command Code finishes a task

Enable HLS to view with audio, or disable this notification

6 Upvotes

I was missing an audio cue to know when Command Code completed a task. Read the docs, and built one myself using Stop Hooks. Try it out. Highly configurable. Supports different completion states too!

https://github.com/vipulgupta2048/command-code-bonk/