Deputy
Claude Code helper: DeepSeek V4.1 Flash reviews Claude's code for bugs and gives second opinions
التثبيت
أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: .cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).
deputy-ccclaude mcp add deputy -e 'DEPUTY_PROVIDER=deepinfra' -e 'DEEPINFRA_API_KEY=<your deepinfra_api_key>' -e 'XAI_API_KEY=<your xai_api_key>' -e 'DEPUTY_MODE=accuracy' -e 'DEPUTY_THINKING=high' -e 'DEPUTY_MODEL=deepseek-ai/DeepSeek-V4.1-Flash-1017' -e 'DEPUTY_BASE_URL=https://api.deepinfra.com/v1/openai' -e 'DEPUTY_WORKSPACE=<DEPUTY_WORKSPACE>' -e 'DEPUTY_API_KEY=<your deputy_api_key>' -- uvx deputy-cc==0.3.1 serve
{
"mcpServers": {
"deputy": {
"command": "uvx",
"args": [
"deputy-cc==0.3.1",
"serve"
],
"env": {
"DEPUTY_PROVIDER": "deepinfra",
"DEEPINFRA_API_KEY": "<your deepinfra_api_key>",
"XAI_API_KEY": "<your xai_api_key>",
"DEPUTY_MODE": "accuracy",
"DEPUTY_THINKING": "high",
"DEPUTY_MODEL": "deepseek-ai/DeepSeek-V4.1-Flash-1017",
"DEPUTY_BASE_URL": "https://api.deepinfra.com/v1/openai",
"DEPUTY_WORKSPACE": "<DEPUTY_WORKSPACE>",
"DEPUTY_API_KEY": "<your deputy_api_key>"
}
}
}
}
متغيرات البيئة
DEPUTY_PROVIDERdeepinfra (DeepSeek V4.1 Flash) or xai (Grok, default model grok-4.3).DEEPINFRA_API_KEYسري DeepInfra API key (deepinfra.com, Dashboard > API Keys), for the default provider. Only sent to api.deepinfra.com.XAI_API_KEYسري xAI API key (console.x.ai), when DEPUTY_PROVIDER is xai. Only sent to api.x.ai.DEPUTY_MODEaccuracy: Claude writes all code; Deputy reviews and consults. lean: fewest Claude tokens, little accuracy loss. balanced: Deputy takes mechanical work. partner: Deputy does all low-level work and gives ideas. savings: Deputy takes most coding.DEPUTY_THINKINGHow hard the helper model thinks.DEPUTY_MODELModel id served by the endpoint.DEPUTY_BASE_URLAny OpenAI-compatible endpoint (https, or http on localhost for a local model).DEPUTY_WORKSPACEProject folder Deputy may read and edit. Defaults to the client's project folder.DEPUTY_API_KEYسري API key for a non-DeepInfra endpoint. Takes precedence over DEEPINFRA_API_KEY.
التوثيق
مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.
المحتويات
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.
claude plugin marketplace add alimohammadiamirhossein/deputy
claude 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)
| Run | Time | Cost |
|---|---|---|
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 angles | 68 s | $0.0018 |
investigate: list a project's functions and their tests | 18 s | $0.0004 |
delegate: fix a bug, add 3 tests, run pytest until green | 46 s | $0.0006 |
Measured on a small demo project with thinking high. On real projects, expect consult and
review to stay under $0.01. Every result shows its real tokens and cost.
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:
| Tool | What it does |
|---|---|
review | Independent reviewers hunt for bugs in Claude's change before it calls the task done |
consult | Second opinions from 2–4 angles at once, before Claude commits to a plan |
investigate | Reads lots of code and returns file:line leads |
delegate | Hands a coding task to the cheap model (off by default; on request, or in savings mode) |
stats | Shows 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:
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:
- Non-trivial changes where a missed bug costs more than a cent: logic, edge cases, 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
balancedorsavingsmode, when you want to save Claude tokens.
Skip it for:
- Trivial edits like typos and one-liners. A review takes 30–60 seconds 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 plugin marketplace add alimohammadiamirhossein/deputy
claude 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
/deputy:review
/deputy:consult I plan to cache sessions in Redis. What am I missing?
/deputy:investigate how does a request reach the database?
Or just work normally: Claude consults and reviews on its own for non-trivial tasks.
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:
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/.
Other MCP clients (Cline, Windsurf, Claude Desktop)
Deputy is on PyPI as deputy-cc. Add a stdio MCP server
that runs:
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. - Private: DeepInfra says it doesn't train on your data. Your code isn't sent to DeepSeek's own servers.
Modes
| Mode | Who writes the code | Pick it when |
|---|---|---|
| accuracy (default) | Claude, always | You want the best result |
| balanced | Claude; Deputy takes boilerplate | You want some savings without risk |
| savings | Deputy, Claude verifies | You 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.
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.
الأسئلة الشائعة
ما هو Deputy؟
Claude Code helper: DeepSeek V4.1 Flash reviews Claude's code for bugs and gives second opinions
كيف أثبّت Deputy؟
يعمل على جهازك. في Claude Code: claude mcp add deputy -e 'DEPUTY_PROVIDER=deepinfra' -e 'DEEPINFRA_API_KEY=<your deepinfra_api_key>' -e 'XAI_API_KEY=<your xai_api_key>' -e 'DEPUTY_MODE=accuracy' -e 'DEPUTY_THINKING=high' -e 'DEPUTY_MODEL=deepseek-ai/DeepSeek-V4.1-Flash-1017' -e 'DEPUTY_BASE_URL=https://api.deepinfra.com/v1/openai' -e 'DEPUTY_WORKSPACE=<DEPUTY_WORKSPACE>' -e 'DEPUTY_API_KEY=<your deputy_api_key>' -- uvx deputy-cc==0.3.1 serve. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.
هل يحتاج Deputy إلى مفتاح API؟
نعم. يتطلب DEEPINFRA_API_KEY, XAI_API_KEY, DEPUTY_API_KEY، وتضبطها في إعداداته.
هل Deputy مفتوح المصدر؟
نعم. شيفرته متاحة على GitHub بترخيص MIT.
من يصون Deputy؟
ينشره alimohammadiamirhossein. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.
من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.