
Deputy
io.github.alimohammadiamirhosseinPublished by GitHub account alimohammadiamirhosseinv0.3.1Updated Oct 29, 2026
Claude Code helper: DeepSeek V4.1 Flash reviews Claude's code for bugs and gives second opinions
Overview
Claude Code helper MCP server that runs a cheap model (DeepSeek V4.1 Flash) to review code, give second opinions, investigate codebases and delegate coding…
- What you can do
- Review risky or large code changes with independent reviewers that hunt for bugs
- Get second opinions from several angles before committing to a plan
- Investigate a codebase and return file:line leads
- Delegate well-specified coding tasks to the cheap model
- Show estimated tokens and dollars saved, per session or over time
- When to use it
- Useful for risky or large changes where a missed bug costs more than a minute of waiting, for a cheap second opinion before settling on a design, and for wide reading in a large codebase. Skip it for routine changes whose tests pass, and for code you cannot share with a third party.
- Requirements
- Runs locally over stdio via uvx (uv required) or as a Claude Code plugin. Needs a DeepInfra API key in DEEPINFRA_API_KEY, or XAI_API_KEY when DEPUTY_PROVIDER is xai; DEPUTY_BASE_URL can point at any OpenAI-compatible endpoint, including a local model. DeepInfra requires pay-as-you-go credit.
Installation
In SourceWeft
- Open Deputy in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Deputy
Deputize cheap models. Claude stays the sheriff.
Deputy is a Claude Code plugin and MCP server that has a cheap model, DeepSeek V4.1 Flash, review Claude's code for bugs and give second opinions, for under a cent each. Claude keeps writing the code.
[GitHub stars] [CI] [PyPI] [License: MIT] [MCP]
[Deputy reviews an uncommitted change in Claude Code: two cheap reviewers flag an off-by-one bug for a tenth of a cent, and Claude confirms it with the repro before fixing it]A replay of one benchmark case. Deputy's findings, time and cost, the repro and the test run are real.
Inside Claude Code the same thing is /plugin marketplace add alimohammadiamirhossein/deputy.
You need uv and a
DeepInfra API key.
What it costs (measured)
Measured on a small demo project with thinking high. Reviews and second opinions now think at
low by default, which makes them faster and cheaper (see the review benchmark below). On real
projects, expect consult and review to stay under $0.01. Every result shows its real tokens
and cost.
Benchmark: Opus with and without Deputy
Four small Python tasks with hidden tests Claude never sees (bench/),
one run each on Claude Opus 5.5, October 2026. These runs predate the faster reviews: reviewers
then thought at high with no time limit, and the prompt asked Claude to review every task.
What this shows, and what it doesn't:
- No accuracy gain to measure here. The tasks are too easy: Opus passed every hidden test on its own.
- Reviews cost Claude more than they cost Deputy. Deputy's share is about a cent, but Claude
spends more checking the findings, so a reviewed task cost 68% more and took longer. One review
took 24 minutes because a reviewer thought for 73k tokens. Reviewers now think at
lowand stop after 180 s, and Claude reviews only risky or large changes. - The findings still changed the code. In 3 of 4 tasks Claude hardened the code beyond the spec: it fixed a rate limiter that a NaN timestamp would block forever, and added missing tests. It rejected one finding that contradicted the spec.
- Delegating saved nothing on tasks this small. Claude's own reading and checking cost about as much as writing the code itself.
- Small sample. One run per config. Full table: bench/results/2026-10-24-opus.
Does review catch bugs, and how often does it cry wolf?
Deputy's review on its own, without Claude, on 6 changes with a planted bug and 8 clean changes.
Each planted bug has a clean twin, the same change done right. Five runs each with the default
settings (bench/review_cases):
- Every planted bug was caught, at major or critical severity, by both reviewers every time.
- Reviews are quick. Reviewers think at
lowand stop after 180 s. Withhighthinking and no cap they caught the same bugs, but the median clean review took 160 s and the slowest 23 minutes. - Clean code still draws findings, so Claude has to check each one. Most are minor (36 of 50), but a quarter of clean reviews included a major claim.
- Many of those findings are fair, such as a test that can't fail, an entry point no test covers, or a cache key wider than the change assumed.
- The benchmark already fixed one cause of false alarms. In the first run, reviewers read new
files labelled "(untracked)" as left out of the change. Deputy now shows them as
git diffdoes, and those findings went from 6 to 0. - Agreement is weak evidence on clean code. Both reviewers flagged the same spot on 20% of clean diffs, so a finding isn't real just because two reviewers report it.
- Every finding on a clean diff is listed in the results:
default settings,
highthinking, no cap, first run.
What it does
Claude (for example Opus 5.5) stays in charge and writes the code. Deputy adds four tools that run a much cheaper model as a helper inside your project:
Claude treats everything Deputy says as an unverified hint: it checks each finding against the code and keeps only what holds up.
See what you saved
Every result ends with a one-line estimate, for example from a real investigate run:
Ask Claude for stats, or run deputy stats, for totals. Reviews and second opinions are listed
separately as extra checks, so they never inflate the savings. The estimate assumes your lead
model would use about as many tokens, so treat it as an order of magnitude. Only numbers are
stored, never code or prompts. Set your lead model with DEPUTY_LEAD_MODEL (opus, sonnet,
haiku, fable or custom).
When to use Deputy, and when not to
Use it for:
- Risky or large changes, where a missed bug costs more than a minute of waiting: tricky logic, security, data handling, concurrency, refactors that touch several files.
- A second opinion before Claude commits to a design, without spending Claude tokens on it.
- Wide reading in a big codebase, such as "where is this setting read?".
- Well-specified mechanical work (boilerplate, renames, test scaffolding) in
lean,balanced,partnerorsavingsmode, when you want to save Claude tokens on larger jobs. On small tasks it saved nothing in the benchmark.
Skip it for:
- Routine changes whose tests pass, and trivial edits like typos and one-liners. A review makes you wait and adds little there.
- Code you may not share with a third party. Deputy sends code to DeepInfra, or to whatever
endpoint you set in
DEPUTY_BASE_URL(a local model works too). - Final answers. Findings come from a weaker model and include false positives, which is why Claude verifies every one.
- Architecture and security-sensitive decisions in
savingsmode. Keep those with Claude.
Quick start
1. Get a DeepInfra API key (DeepInfra hosts DeepSeek's models in the US)
- Sign up at deepinfra.com with GitHub, Google or email.
- In Dashboard → Billing, add a card and $5–10 of credit, then set a spending limit equal to that amount.
- In API Keys, create a key (it starts with
sk-di-) and copy it. Keep it private.
You don't need a plan, a model purchase or a dedicated GPU. Pay-as-you-go credit is enough.
2. Install uv and the plugin
Claude Code asks for your DeepInfra key and stores it in your system's secure storage.
3. Restart Claude Code and try it
Or just work normally: Claude calls Deputy on its own when it pays off, and skips reviews on routine changes whose tests pass.
Cursor and Codex
One command adds Deputy to the editor's MCP config (with a backup of the old file) and installs the playbook as a Cursor rule or Codex skill:
Set DEEPINFRA_API_KEY in your environment first, then restart the editor. Add --dry-run to
see the changes without writing them. Ready-made files are in
integrations/.
Grok instead of DeepSeek (experimental, not tested yet): Grok support follows xAI's
documentation but has not been run with a real xAI key. If you try it, please
tell us what worked and what didn't, even if it was just a one-word "works".
Add --provider xai and set XAI_API_KEY (from console.x.ai)
instead. Deputy then uses grok-4.3; set DEPUTY_MODEL to grok-build-0.1 (xAI's coding model)
or grok-4.7 (its strongest). Grok costs about 10 times more per token than DeepSeek V4.1
Flash.
Other MCP clients (Cline, Windsurf, Claude Desktop)
Deputy is on PyPI as deputy-cc. Add a stdio MCP server
that runs:
with DEEPINFRA_API_KEY set in its environment. Check your setup with uvx deputy-cc doctor.
Recommended model: DeepSeek V4.1 Flash, thinking high
The default is deepseek-ai/DeepSeek-V4.1-Flash-1017 on DeepInfra with thinking set to high.
It's the best price-to-quality option we found for this job:
- Cheap: $0.098 per 1M input tokens and $0.294 per 1M output tokens (October 2026), cheaper than DeepSeek's own API.
- Capable: about 1M tokens of context and reliable tool calling.
- Thinking actually on: DeepInfra leaves its thinking off unless asked. Deputy always asks
(
high), which we confirmed by measuring the reasoning tokens. - Quick reviews:
reviewandconsultthink atlowby default. In the review benchmark it caught the same planted bugs ashighin less than half the time. SetDEPUTY_LENS_THINKING=highfor deeper, slower reviews. - Private: DeepInfra says it doesn't train on your data. Your code isn't sent to DeepSeek's own servers.
Modes
Change it in the plugin settings (/plugin) or with DEPUTY_MODE.
Learn more
- SKILL.md: the playbook Claude follows (consult → decide → implement → review → check each finding). Also works without the plugin.
- docs/REFERENCE.md: all settings, costs, safety, terms of service, the research behind the design, troubleshooting and the roadmap.
- CHANGELOG.md: what changed in each release.
Deputy stays within Anthropic's rules: Claude Code runs unmodified, and Deputy never touches your Claude login. It's an ordinary MCP tool using your own DeepInfra key.
Support the project
If Deputy caught a bug for you, give it a ⭐ and share it with someone who uses Claude Code. Issues and pull requests are welcome; the good first issues are a good place to start.
MIT © 2026 Amirhossein Alimohammadi · Not affiliated with Anthropic, DeepSeek or DeepInfra.
Keywords: Claude Code plugin, MCP server, Model Context Protocol, AI code review, second opinion, DeepSeek V4.1 Flash, DeepInfra, subagent, Opus, agentic coding, reduce Claude Code cost.
Source: README.md at commit fef5868
Tools
0Version history
3- v0.3.1LatestOct 29, 2026
- v0.3.0Oct 25, 2026
- v0.2.0Oct 24, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
