r/opencodeCLI • • 2d ago

Tried "code mode" and I can't currently recommend it

https://github.com/anomalyco/opencode/blob/dev/packages/codemode/README.md

https://github.com/anomalyco/opencode/blob/dev/packages/codemode/README.md

Been trying out the code mode on a couple different projects.

I used Gemini Hydrogen and also Deepseek Flash 1017.

I found it to be really inconsistent. It seemed like subagents would report that they were done/finished before they were. And that shell tasks were also not being reported incorrectly.

Not sure what other people are experiencing but it doesn't seem ready.

Happy to be wrong. But did anyone else try this and have issues?

20 Upvotes

7 comments sorted by

3

u/xmnstr 1d ago

Isn't this how most tool calls work in oc2? It's pretty solid for me, at least.

-5

u/PilgrimofHaqq2 2d ago

I made the same conclusion when I first came across code mode. I had the agent look at all previous sessions (~600) and I asked if codemode would be beneficial to us if we used it. Out of all the sessions, there was only one case where it would've been beneficial. I decided at that point, I wont use codemode at all.

8

u/stvn_wthrsp 2d ago

By what metrics did it decide code mode would not be useful? The point is to reduce turns and therefore time, how did your agent determine code mode would not do that?

2

u/PilgrimofHaqq2 2d ago

4

u/megablue 2d ago

pi...? you realize this is opencodeCLI right?

3

u/PilgrimofHaqq2 2d ago

Yeah I know lol. I tested codemode in Pi because thats the harness I build on. Opencode's version is built differently (its own interpreter, and the main way to reach MCP tools), but the idea is the same. In my A/B tests codemode used 21% more tokens on normal coding tasks and 40% fewer on bulk tool calls. My sessions almost never do bulk tool calls so I kept it off. If your workflow is heavy on MCP it could easily be worth it.

3

u/megablue 2d ago

i can see what you mean, i did some sessions analysis with the agent help, the over 2 days on 3 sessions, the result are generally very positive for me but only if it is being used together with my mega-smart-context plugin that trim the unnecessary toolcall results with strategies borrowed from Headroom and TokenEconomizer plugins. only 1 session has mixed results.

the results are very positive for me, on average, i saved about 40% input tokens or so but then, only when i used "Code Mode" in conjunction with my mega-smart-context plugin.

SessionWhat it looks like
df55512 prompts, 49 model turns. It used Code Mode heavily: 68 execute calls. Each request still took ~24.5 model turns, but the session was cheap per turn: 1.82M billed and 0.63M effective per prompt, with 93% cache. In plain terms: a long implementation session where the model kept working in the same context and reused a lot of it.
df634 prompts, 95 model turns, 49 execute calls. It had the lowest cache (74%) and the highest output per request (17.4k tokens), which fits a session that wrote a lot of new code. Even so, billed per prompt was 1.66M — lower than the older-session median. In plain terms: more writing, less reuse, but still cheaper per request than the old workflow.
e04154 prompts, 689 model turns, 96% cache. It is the plugin-development marathon: huge total (140.9M billed), but only 2.61M per prompt. The stored tool record shows only 10 execute calls, which is incomplete — the host did not keep all tool parts for this long session. In plain terms: a very long, cache-heavy engineering session; don’t read its totals as typical.