The DeepSeek test kit: run V4.1 Flash in Claude Code and compare it with Opus 5
The short version
DeepSeek's cheap model, V4.1 Flash, beat Claude Opus 5 on DeepSWE, 77 to 74. DeepSWE is 113 long coding jobs, the kind where an agent has to read a repo, change several files and not break anything. Flash writes code from 60 cents per million tokens. Opus 5 charges 25 dollars for the same million. It is open under the MIT license, and a few lines of setup point Claude Code at it, so you keep your usual workflow.
The catch: these are DeepSeek's own numbers, and on Terminal Bench, which DeepSeek ran inside Claude Code, Opus 5 still wins 52 to 42. So don't switch everything. Give both models the same real task on your own repo, then compare the result and the bill. This kit is the setup and the three prompts for that test.
| Number | What it means |
|---|---|
| 77 vs 74 | DeepSWE v1.1, V4.1 Flash vs Opus 5 (DeepSeek's table) |
| 113 | long coding jobs in DeepSWE |
| 0.60 USD | Flash, per million output tokens, off-peak (1.20 at peak) |
| 25 USD | Opus 5, per million output tokens |
| 42 vs 52 | Terminal-Bench 4.0, Flash vs Opus 5, run inside Claude Code |
| MIT | the license on the weights |
Sources: DeepSeek release note, 17 Oct 2026 · Model card on Hugging Face · DeepSeek pricing · DeepSeek's Claude Code guide · Anthropic pricing · DeepSWE v1.1
Copy these prompts
Do the setup below first. Then paste these into Claude Code, in this order. Prompt 1 runs on your normal model, prompt 2 runs in the DeepSeek window, prompt 3 runs back on your normal model.
1. Pick the task and freeze the starting point
I want to compare two coding models on one real task in this repo. Suggest three tasks from the open issues,
TODOs or recent bugs that touch more than one file and have a clear definition of done (a test that should
pass, or a behaviour I can check by hand). For the one I pick, write the exact prompt I will give both models,
word for word, and save it to compare/task.md. Then create a branch called compare/base from the current commit
so both runs start from the same place. Don't change any code yet.
2. Run the same task in the DeepSeek window
Read compare/task.md and do exactly what it says. Work on a new branch called compare/deepseek, created from
compare/base. When you are done, run the tests, then write compare/deepseek.md with: the files you changed,
whether the tests pass, anything you were unsure about, and every time you had to guess.
Run the same prompt in your normal window on a branch called compare/claude, ending with compare/claude.md.
3. Compare the result and the bill
Compare the branches compare/claude and compare/deepseek against compare/base. For each one report: do the
tests pass, did it change any file the task did not need, did it remove or weaken any test, how many follow-up
corrections I gave it, and what you would have to fix before merging. Then put the two costs side by side: I
will paste the Claude usage and the DeepSeek usage for this session. End with one line: for this kind of task,
which model would you use, and why.
The exact Claude Code setup
From DeepSeek's own guide. Get an API key from the DeepSeek Platform and top up a few dollars. Then run this in a new terminal window (Mac or Linux) before you start Claude Code:
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API key>
export ANTHROPIC_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
export CLAUDE_CODE_EFFORT_LEVEL=max
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=786432
cd /path/to/your-project
claude
On Windows (PowerShell) the names are the same: $env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic" and so on.
Good to know:
- These variables only last for that terminal window. Close it and open a new one, and you are back on your normal Claude setup. That is what makes the side by side test easy: one window on DeepSeek, one on Claude.
- Billing goes to your DeepSeek balance, not your Claude plan. Check the usage page there after the run.
- DeepSeek maps model names. Anything named
claude-opusgoes to V4 Pro, which costs more. The block above pins everything to Flash, so a subagent cannot quietly switch. - Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday. Outside those, weekends included, Flash is half price.
The numbers, in full
DeepSeek's own table, from the model card:
| Test | V4.1 Flash | Opus 5 | Who wins |
|---|---|---|---|
| DeepSWE v1.1 (113 long coding jobs) | 77.0 | 74.0 | DeepSeek |
| Terminal-Bench 4.0 (run in Claude Code) | 42.3 | 51.8 | Opus 5 |
| ProgramBench | 29.1 | 37.0 | Opus 5 |
| NL2Repo-Bench | 68.2 | 75.3 | Opus 5 |
| Automation-Bench | 60.5 | 50.3 | DeepSeek |
Price per million tokens:
| Flash off-peak | Flash peak | Opus 5 | |
|---|---|---|---|
| Input | 0.15 USD | 0.30 USD | 5 USD |
| Input, cached | 0.003 USD | 0.006 USD | 0.50 USD |
| Output | 0.60 USD | 1.20 USD | 25 USD |
The catch
- These are DeepSeek's own numbers. The company is grading its own model. Wait for outside runs before you trust the 77.
- Opus 5 still wins most of the table, including Terminal-Bench, the one DeepSeek ran inside Claude Code.
- It is Opus 5, not Opus 5.5. Anthropic's newer model is not in the table.
- Open does not mean it runs on your laptop. At 763B parameters, the download is for teams with serious GPUs. The license matters because other hosts can serve it; most builders will use the API.
- Check the data policy before you paste anything private. No secrets, no customer data, until you know where it goes.
Steal this for your app
- The priciest model is not always the best coder, so test before you pay for every task.
- One task, two windows, same commit, same prompt. Anything else is not a fair test.
- Judge the diff, not the chat: tests pass, no extra files changed, no tests weakened.
- Keep a short log for a week: task, model, passed or not, cost. After 20 tasks you know your own split better than any benchmark.
- Start the cheap model on the frequent, small work: subagents, tests, docs, small edits. Keep your best model for long terminal work.
Run this on your codebase
Look at the last 20 tasks I gave you in this repo (use git log and the commit messages). Sort them into two
groups: routine work (small features, clear bugs, tests, docs, refactors) and hard work (long multi-step
debugging, migrations, setup scripts, anything that needed many terminal commands). For each group, pick one
example I could rerun as a fair comparison between two models, and write the exact prompt for it.