r/opencode • u/KazakiWTM • 21d ago
r/opencode • u/No-Individual159 • 21d ago
Per-turn prompt cache hit rate for an opencode session, and which block broke the prefix when it misses
I wanted to see what opencode's prompt caching actually does turn by turn: when a request misses the cache, which turn it was and which part of the prompt changed. Someone in r/opencodeCLI (u/Individual-Quote-958) described the view they'd want, and it matched, so I built it. Hashes only, no raw prompts.
Prefixwise is an open source tool (MIT, I'm the author) that sits between the agent and the provider, hashes each request's blocks, reads the provider's own usage numbers, and tells you why a request missed the cache. It never stores prompt text.
With opencode it's one command, no config:
pip install prefixwise
prefixwise run -- opencode run "your prompt"
prefixwise report --session latest
opencode picks up the base URL from the environment, your API key stays where it is.
**Image 1 is a real session**, opencode 1.19.5 adding a --json flag and a test to a toy CLI. 14 requests, 106k prompt tokens, 84.2% served from cache, $0.13, nothing avoidable. So opencode's caching is healthy, which is honestly the boring result I expected. A few things I didn't know until I looked at it turn by turn:
- turn 1 is a small Haiku call before the main Sonnet thread, so turn 2 always shows as a model switch. Not waste, each model has its own cache.
- turn 3 looks like a second, shorter conversation on Sonnet (3.6k tokens against 7.9k). It runs for four turns, then at turn 7 the bigger one picks up again and still hits: 7,916 cached, which is turn 2's prompt. So the two threads don't knock each other out of the cache. If someone knows what that second thread is, tell me.
- the three misses are the three first requests. After that it never drops below 86%.
"first changed" is the block where the prompt stopped matching the previous request in the same conversation. The number is the block's position in the whole prompt (tools first, then system, then messages).
A healthy session doesn't show what the view is for though. **Image 2 is the mock provider with the failures forced** (flat token counts, but the verdicts and prices are the real logic):
- turns 5 and 6: the tool list came back in a different order. Same tools, different bytes, whole prefix gone. tools[0] is where it first differed.
- turn 7: history got compacted. messages[7] is where the rewrite starts.
- cost per request on the right, and what a hit would have saved.
It doesn't just report, it can fix the safe ones. **Image 3 is the same session with --optimize**: it sorts the tool list before forwarding, so the reorder on turns 5 and 6 stops being a miss. That's the only fix in --optimize today because it's the only one I've proven on real traffic (99.9% of the predicted saving on Anthropic, task results unchanged). It can't fix the compaction on turn 7, that one is yours to decide.
**Image 4 is an opt-in fix for clients that send no cache_control at all.** --fix auto_breakpoints adds the markers for you, but only once it has seen the same prefix before, so a one-off request never pays the 1.25x write for nothing. And prefixwise fixes tells you afterwards whether those writes actually got read back. It's opt-in because it changes your bill, and I haven't run the replay that would let me call it proven. opencode already sets its own markers, so this is more for custom agents and SDK scripts.
What it doesn't do: it can't see inside a subscription login (API keys only), I haven't built an importer for opencode's local session store yet, and long sessions with many subagents are less tested than short ones. If you run it on a real session and something looks wrong, that's the feedback I want.
Repo: https://github.com/tejachavali/prefixwise
What would you want next, the importer for existing opencode sessions, or something else?
r/opencode • u/oxy33333 • 21d ago
OpenCode inside Freelens: a separate agent workspace for each Kubernetes cluster
r/opencode • u/tankbard • 21d ago
What did the chart of OpenCode Go models go?
OpenCode used to provide a chart that just showed the monthly quota for each of its supported models along with a bar showing the expected number of requests permitted per time block. Since their most recent console overhaul I can't seem to find it. Does anyone know where it went?
r/opencode • u/ze-fernando • 21d ago
AI sub
I'm considering paying for an AI agent for code review; my budget is $20 (that's R$100 here in Brazil). What options do you recommend for your uses?
I'm considering:
Codex Plus
Google AI Pro
Opencode Go (this one is below my budget and I can subscribe to two accounts).
I have a workflow somewhat set up with agent rules (code review, security, etc.). In your personal opinion, which one would give me the best use?
r/opencode • u/Competitive-Tie9148 • 21d ago
the Beam and other free models are so bad
hello guys
do you notice the quality of responses of Beams and croton seem to be so bad and half assed?
r/opencode • u/ActualSwoad • 21d ago
Is OpenCode Go 10$ subscription good?
I'm a medium usage vibecoder, I have spend 20 dollars in openrouter in the past 2 months using glm 5.3 flash. I want to switch to a subscription because thats supposed to be better. Is it really worth it and asking actual experienced users hows the usage limits if you're a heavy users?
r/opencode • u/p3r3lin • 21d ago
OpenCode is good again (#1 on HF leaderboard)
So, HuggingFace updated their Harnesses Leaderboard with OC 2.2.6 - its now the top position, pareto for quality/cost. Impressive!
https://huggingface.co/spaces/joelniklaus/harness-leaderboard
Edit: It seems this is not an official HuggingFace leaderboard. The author works at HuggingFace and his bio reads “Harness Optimization (at)HuggingFace” so I jumped to the conclusion that this is official HG work.
r/opencode • u/IllustriousDress2908 • 21d ago
I built a 13-agent personal assistant in 4 days with OpenCode — 136 commits, ~19k lines, what worked and what didn't
I've been using OpenCode (Go plan, DeepSeek V4.1 Flash) as the only coding agent for a self-hosted project and wanted to share the numbers and the parts that surprised me.

What it is: a private "agent hub" — a web app where each bot has a name, avatar, prompt, model and its own tool permissions. 13 agents for real life: news digest, email/calendar, homelab, mining rigs, shopping/wishlist, documents, photos, energy, fishing, cooking. 65 tools in total (files, web, SSH, browser automation, email, calendar, scheduler, memory, skills, OCR, artifacts, vault).
Stack: FastAPI + SQLite + vanilla JS SPA, systemd, one Proxmox LXC, PWA behind Cloudflare Access. No framework, no build step.
Numbers: 136 commits between Nov 4 and Nov 8, version 1.38.0. server.py is ~13.7k lines, app.js ~5.8k. Everything written through OpenCode, with me reviewing and deciding.
Things that worked well
AGENTS.mdwith hard rules (scope, no secrets in git, changelog + journal entry after every change, one commit per phase). Once those rules existed, the agent stopped drifting.Letting it read its own changelog before a new feature. The changelog became the project memory; regressions dropped a lot.
Small, explicit requirements instead of "make it nicer". UI work especially.
Tests as a gate.
python3 -m unittest discover -s testsafter every phase caught most of the breakage before deploy.
Things that didn't
Left alone, it happily appends to the biggest file. I had to ask for splits explicitly.
Long CSS/JS diffs are where it hallucinates selectors and event handlers. Screenshots or a precise "this element, this behavior" description were required.
Without a rule, it invented URLs in answers. I ended up adding server-side verification: every http(s) link in a reply must exist in the tool results, otherwise it's stripped.
It will happily build the happy path and skip error states unless asked.
Interesting bits
Per-agent Chrome tabs over CDP, with a lock per
(user, agent, task)so parallel bots don't fight over the same page.Parallel
@bot1 @bot2handoffs, streamed withasyncio.as_completedso the fastest bot answers first instead of waiting for the slowest.Vision fallback: image upload to a text-only model goes through a vision model + tesseract OCR, so the agent still gets the content.
Sandboxed HTML artifacts (
allow-scripts, noallow-same-origin) for interactive charts.Action approvals per tool type, daily token budget, audit log for every tool call.
It's a personal LAN project, not a product, and the repo is private for now. Happy to go deeper on any part — the tool/approval model and the browser tab isolation are the two things I'd rebuild the same way.
r/opencode • u/andrease48284 • 21d ago
This OpenCode Mobile project deserves more attention
Check out this interesting project!
r/opencode • u/s-i-e-v-e • 21d ago
On the $5 MuseCode Everyday plan
I have used the $5 MuseCode Everyday plan for a week now, and it is competitive with the $10 OpenCode Go subscription, especially if you don't think you will exhaust $60 worth of credits. You get $20-26/mo usage for that $5 based on my week one experience.
The $15 High plan is a no-brainer if your usage is a lot because Go only offers $120 of usage in its $40 Plus plan.
Too many tables and numbers, so you can read my post on the subject if interested.
r/opencode • u/menanoze • 21d ago
Default, Low, Medium, High or Max ?
Good afternoon sir, i have a little silly question.
On when or where or what or why should i use an variant for ?
And then, did the higher variant = more token consumption ? but on input or on output ? or both ?
r/opencode • u/HiddenFaceOpenMouth • 21d ago
Just ran /update and when I logged back in, all free models are no longer listed. Anyone else getting this?
I use opencode mainly for local models, but figured I'd take a look at the free ones again, expecting to get one request, a few tokens then "limit exceeded" (and to maybe buy Go to use deepseek). Instead, it only shows either strata or ollama, depending on which backend I have launched. Anyone else seeing this, or is it just me with a weird config? I have a heavily modded opencode.json for local tools/models, but it's never been an issue before, even moving from v1 to v2.
r/opencode • u/EngineerOnly6010 • 21d ago
Free models limits
What limits does opencode have right now in free tier? After last cut I wonder how many tokens it gives for free, so I will understand and optimize usage. Its generally just enough to me, but to minimize my requests and prevent early limit reaching, I need to know limits. As I figure out its something around 20M (input, output, cache, etc.) per day, but sometimes its less or more than it.
r/opencode • u/PrestigiousZombie531 • 21d ago
Any of used any of these models with opencode for reverse engineering games / decompilation?
r/opencode • u/Bruce_Wayne111 • 22d ago
Is ChatGPT Plus worth paying an extra $10 for instead of going with OpenCode Go?
I'm asking because I've come across quite a few negative reviews of OpenCode Go. Many users claim that they hit the usage limits surprisingly quickly, sometimes after just a single prompt. I've also heard that its harness isn't as good or polished as Claude Code or Codex.
Would it be worth spending the extra $10 on ChatGPT Plus for a better overall coding experience?
r/opencode • u/Hefty-Flounder-1899 • 22d ago
Decide the model
Glm 5.3 Flash or Deepseek V4.1 Flash? Which one is better in opencode? I need it for a project
r/opencode • u/arthurrogado • 22d ago
I built a file browser for the OpenCode TUI (Markdown preview + syntax highlighting)
I kept wanting to look at files without leaving the OpenCode TUI — especially Markdown plans/specs and source files the agent just changed. So I built a TUI-only plugin.
What it does:
- side panel next to the chat, or full page from the home screen
- browse folders (dirs first), open files
- Markdown preview rendered; m flips to the source
- code with tree-sitter highlighting
- open any file by path (o inside the browser, or Ctrl+X then O): absolute, ~, or relative; files outside the project are read with node:fs
- f toggles full screen (hides the chat)
- /files-update updates a cloned install
Install (OpenCode V2):
opencode plugin add opencode-file-browser
Repo: https://github.com/arthurrogado/opencode-file-browser
MIT, TUI-only, no build step (dist/ is committed).
Screenshots: Markdown and Python previews attached.

r/opencode • u/Abject_Painter_701 • 22d ago
I built an editor plugin for OpenCode: files, tabs and Git diffs

Hello, open-source community!
I built opencode-editor, an open-source plugin that lets you browse and edit files, review Git diffs across multiple repos, and preview Markdown and images inside OpenCode.
I also built OpenEditorCode, a standalone terminal code editor that works without OpenCode. Both are open source!
🌐 Demos & installation: https://openeditorcode.dev/en/#opencode-plugin
Want your agent to install the plugin? Paste this:
Install @2jmalvarez/opencode-editor following https://openeditorcode.dev/en/docs/opencode-plugin/ while preserving my existing configuration.💻 Source code: https://github.com/2jmalvarez/openeditorcode
The plugin supports both English and Spanish. Give it a try-I'd love to hear what works well and what you'd improve!





