Deputy

io.github.alimohammadiamirhossein由 GitHub 帳號 alimohammadiamirhossein 發布v0.3.1更新於 Oct 29, 2026

Claude Code helper: DeepSeek V4.1 Flash reviews Claude's code for bugs and gives second opinions

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

Claude Code 輔助 MCP 伺服器,用便宜模型(DeepSeek V4.1 Flash)審查程式碼、提供第二意見、調查程式庫並委派編碼任務。

可以做什麼
  • 用獨立審查者檢查有風險或較大的程式碼變更,找出錯誤
  • 在確定方案前從多個角度取得第二意見
  • 調查程式庫並回傳檔案與行號線索
  • 把規格明確的編碼任務交給便宜模型處理
  • 顯示本次工作階段或累計估算節省的 token 與費用
適用情境
適合有風險或較大的變更(漏掉錯誤的代價高於多等一分鐘)、在確定設計前取得便宜的第二意見,以及在大型程式庫中廣泛閱讀。測試已通過的例行變更,以及不能與第三方分享的程式碼,不建議使用。
執行需求
透過 uvx 以 stdio 在本機執行(需要 uv),也可作為 Claude Code 外掛安裝。需要 DEEPINFRA_API_KEY 中的 DeepInfra API 金鑰;當 DEPUTY_PROVIDER 為 xai 時需要 XAI_API_KEY。DEPUTY_BASE_URL 可指向任何相容 OpenAI 的端點,包括本機模型。DeepInfra 需按用量付費儲值。
安裝前請注意
會把程式碼傳送到 DeepInfra 或 DEPUTY_BASE_URL 指定的端點,因此不要用於不能與第三方分享的程式碼。DeepInfra 需要綁定信用卡並儲值,Grok 每 token 費用約為 DeepSeek 的十倍。結論來自較弱的模型,會有誤報,只能當作線索而非最終答案。在 partner 與 savings 模式下由輔助模型撰寫程式碼,再由 Claude 核對。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Deputy,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Deputy sheriff badge logo]

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.

bash
claude plugin marketplace add alimohammadiamirhossein/deputyclaude plugin install deputy@deputy

Inside Claude Code the same thing is /plugin marketplace add alimohammadiamirhossein/deputy. You need uv and a DeepInfra API key.

What it costs (measured)

RunTimeCost
review: two reviewers check a change with a planted off-by-one bug (both caught it)27 s$0.0011
consult: second opinions from 2 angles68 s$0.0018
investigate: list a project's functions and their tests18 s$0.0004
delegate: fix a bug, add 3 tests, run pytest until green46 s$0.0006

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.

ConfigHidden tests passedMean cost (Claude + Deputy)Median time
Opus alone4/4$0.1830 s
Opus + /deputy:review4/4$0.31 ($0.30 + $0.013)3.7 min
Opus + /deputy:delegate4/4$0.19 ($0.19 + $0.0015)76 s

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 low and 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):

DiffsReviewsFlaggedFlagged major or criticalMean costMedian timeSlowest
Planted bug3030/30 caught30/30$0.001628 s59 s
Clean4022/4010/40$0.003980 s230 s
  • Every planted bug was caught, at major or critical severity, by both reviewers every time.
  • Reviews are quick. Reviewers think at low and stop after 180 s. With high thinking 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 diff does, 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, high thinking, 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:

ToolWhat it does
reviewIndependent reviewers hunt for bugs in a risky or large change before Claude calls it done
consultSecond opinions from 2–4 angles at once, before Claude commits to a plan
investigateReads lots of code and returns file:line leads
delegateHands a coding task to the cheap model (off by default; on request, or in savings mode)
statsShows roughly how many tokens and dollars Deputy saved: this session, today, this week, all time

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:

text
Savings (rough): this work would cost about $0.0082 on Claude Opus 5.5; Deputy did it for $0.0001. Saved about $0.0074 and 2.0k Claude Opus 5.5 tokens.

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, partner or savings mode, 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 savings mode. Keep those with Claude.

Quick start

1. Get a DeepInfra API key (DeepInfra hosts DeepSeek's models in the US)

  1. Sign up at deepinfra.com with GitHub, Google or email.
  2. In Dashboard → Billing, add a card and $5–10 of credit, then set a spending limit equal to that amount.
  3. 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

bash
claude plugin marketplace add alimohammadiamirhossein/deputyclaude plugin install deputy@deputy

Claude Code asks for your DeepInfra key and stores it in your system's secure storage.

3. Restart Claude Code and try it

text
/deputy:review/deputy:consult I plan to cache sessions in Redis. What am I missing?/deputy:investigate how does a request reach the database?/deputy:ds add input validation to the signup form, with tests

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:

bash
uvx --from git+https://github.com/alimohammadiamirhossein/deputy deputy setup cursor --project .uvx --from git+https://github.com/alimohammadiamirhossein/deputy deputy setup codex

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.

bash
uvx --from git+https://github.com/alimohammadiamirhossein/deputy deputy setup cursor --project . --provider xai

Other MCP clients (Cline, Windsurf, Claude Desktop)

Deputy is on PyPI as deputy-cc. Add a stdio MCP server that runs:

bash
uvx deputy-cc serve

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: review and consult think at low by default. In the review benchmark it caught the same planted bugs as high in less than half the time. Set DEPUTY_LENS_THINKING=high for deeper, slower reviews.
  • Private: DeepInfra says it doesn't train on your data. Your code isn't sent to DeepSeek's own servers.

Modes

ModeWho writes the codePick it when
accuracy (default)Claude, alwaysYou want the best result
leanClaude for small and tricky changes; Deputy reads code and takes larger well-specified workYou want to spend as few Claude tokens as possible with little loss of accuracy
balancedClaude; Deputy takes boilerplateYou want some savings without risk
partnerDeputy does all low-level work; Claude checks every diffYou want Deputy doing the legwork and pitching ideas, with Claude verifying
savingsDeputy, Claude verifiesYou want to save the most tokens

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.

[Star History Chart]


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.

來源:README.md,提交 fef5868

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v0.3.1最新Oct 29, 2026
  2. v0.3.0Oct 25, 2026
  3. v0.2.0Oct 24, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分