DEV Community

Petr Tcoi
Petr Tcoi

Posted on Edited on

My hack: Claude thinks, DeepSeek in OpenCode does the work

Most of my work is simple: build pages from ready copy, run tests, translate a UI, collect sources. If I do all of that in Claude or Codex, my limits go to routine instead of the hard problems.

So I split the roles:

  • Claude or Codex breaks the task down, writes the spec, reviews the result and ships it;
  • DeepSeek V4.1 Flash in OpenCode executes the spec.

It has to be OpenCode. It is a terminal agent just like Claude Code: it reads the project, runs commands and commits on its own. DeepSeek comes with the OpenCode Go subscription for $10 a month, and that is enough for me.

24 days in numbers

OpenCode keeps its history in a local SQLite database, so usage is one query away:

select count(*), sum(tokens_input)/1e6, sum(tokens_cache_read)/1e6, sum(tokens_output)/1e6
from session_v2;
Enter fullscreen mode Exit fullscreen mode

From Nov 12 to Dec 5 I ran 136 sessions: 61M fresh input tokens, almost 5B read from cache, 8.6M output. Rate-limit errors: zero.

The cache is why the limits last. On every step the agent resends the whole history to the model, but the beginning of the request does not change, so the provider serves it from cache. For me that was almost 99% of all input. The rule that follows: one big spec in one session is cheaper than ten small tasks, because every new session reads the project from scratch.

How to keep a cheap model from screwing up

A cheap model will not think for you. If the spec has a gap, it fills it its own way, and confidently. So all the thinking stays in the spec:

  1. The task is cut into packages, each with a checkable definition of done.
  2. Website copy is given verbatim, in backticks.
  3. Prohibitions are explicit: do not touch package.json, do not invent numbers, do not push to main.
  4. Review follows its own spec and is mechanical: "extract the strings from the spec with a script and find each one with grep -F", not "check that everything looks fine".

What it looks like in practice

Recently I added 12 service pages to my site. Claude's spec came out at 617 lines, and DeepSeek went through all 5 packages in 18 minutes. The scripted check found all 431 strings from the spec in the code. I had one line left to fix before shipping.

Do not take the review on faith either. The same day, on another task, the reviewer agent reported "done" while the pages showed placeholders instead of images. Claude caught them when it opened the page preview itself. That is why the final look always belongs to the expensive model and to me.

How Claude drives OpenCode itself

I used to hand specs to OpenCode manually. Now Claude Code launches DeepSeek itself through the OpenCode CLI:

opencode run -m opencode-go/deepseek-v4.1-flash --auto --format json \
  --title "LeadsAlarm card-actions" \
  "Execute the spec in docs/tz/00-TZ.md" > run.jsonl
Enter fullscreen mode Exit fullscreen mode
  • The command runs in the background, and Claude spends no tokens of its own while DeepSeek works. When DeepSeek finishes, Claude gets a notification, reads the report and the diff, and runs the tests.
  • Claude takes the sessionID from the first JSON event. Review notes go back into the same conversation with opencode run --session <id> "...", so DeepSeek continues with full context and the same cache.
  • --auto approves everything that is not explicitly denied, without me, so DeepSeek works in a separate copy of the project (git worktree), and that copy's opencode.json denies the dangerous commands:
{"permission": {"bash": {"*": "allow", "*git push*": "deny", "*railway*": "deny", "psql*": "deny"}}}
Enter fullscreen mode Exit fullscreen mode

On top of that, a pre-push hook makes git refuse any push from that copy. Nothing ships until Claude has checked it and I say yes.

The first task on this setup, a new LeadsAlarm feature in 6 packages, went like this:

  • DeepSeek worked for 37 minutes with no hangs and not a single confirmation prompt. It finished 5 packages and skipped one, explaining why: the amoCRM docs do not allow it.
  • Every package got two commits: failing tests first, then the code. Claude ran the tests itself (527, zero failures) and checked that the tests from the first commits really failed.
  • Claude found one serious bug: DeepSeek put a new count into a daily job with no exception handling, so one failure would have stopped that job for every customer.
  • The deny rules worked: OpenCode refused three psql calls, and DeepSeek found another way to check.
  • Claude sent its review notes into the same conversation with --session, and DeepSeek carried on with full context.

Bottom line

The expensive model spends tokens on thinking, the cheap one on doing. It only works if everything is decided up front in the spec and the result can be checked by a script.

Top comments (0)