deputy-cc 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. deputy_cc-0.2.0/.claude-plugin/icon.png +0 -0
  2. deputy_cc-0.2.0/.claude-plugin/marketplace.json +15 -0
  3. deputy_cc-0.2.0/.claude-plugin/plugin.json +57 -0
  4. deputy_cc-0.2.0/.github/workflows/ci.yml +25 -0
  5. deputy_cc-0.2.0/.github/workflows/release.yml +99 -0
  6. deputy_cc-0.2.0/.gitignore +20 -0
  7. deputy_cc-0.2.0/CHANGELOG.md +55 -0
  8. deputy_cc-0.2.0/LICENSE +21 -0
  9. deputy_cc-0.2.0/PKG-INFO +232 -0
  10. deputy_cc-0.2.0/README.md +201 -0
  11. deputy_cc-0.2.0/SKILL.md +66 -0
  12. deputy_cc-0.2.0/bench/README.md +65 -0
  13. deputy_cc-0.2.0/bench/run.py +225 -0
  14. deputy_cc-0.2.0/bench/tasks/booking_ranges/hidden/test_hidden.py +47 -0
  15. deputy_cc-0.2.0/bench/tasks/booking_ranges/repo/ranges.py +25 -0
  16. deputy_cc-0.2.0/bench/tasks/booking_ranges/repo/test_ranges.py +13 -0
  17. deputy_cc-0.2.0/bench/tasks/booking_ranges/task.md +12 -0
  18. deputy_cc-0.2.0/bench/tasks/expense_report/hidden/test_hidden.py +49 -0
  19. deputy_cc-0.2.0/bench/tasks/expense_report/repo/report.py +7 -0
  20. deputy_cc-0.2.0/bench/tasks/expense_report/repo/test_report.py +9 -0
  21. deputy_cc-0.2.0/bench/tasks/expense_report/task.md +16 -0
  22. deputy_cc-0.2.0/bench/tasks/rate_limiter/hidden/test_hidden.py +49 -0
  23. deputy_cc-0.2.0/bench/tasks/rate_limiter/repo/ratelimit.py +12 -0
  24. deputy_cc-0.2.0/bench/tasks/rate_limiter/repo/test_ratelimit.py +8 -0
  25. deputy_cc-0.2.0/bench/tasks/rate_limiter/task.md +10 -0
  26. deputy_cc-0.2.0/bench/tasks/rename_refactor/hidden/test_hidden.py +53 -0
  27. deputy_cc-0.2.0/bench/tasks/rename_refactor/repo/accounts/__init__.py +6 -0
  28. deputy_cc-0.2.0/bench/tasks/rename_refactor/repo/accounts/admin.py +8 -0
  29. deputy_cc-0.2.0/bench/tasks/rename_refactor/repo/accounts/billing.py +9 -0
  30. deputy_cc-0.2.0/bench/tasks/rename_refactor/repo/accounts/notify.py +8 -0
  31. deputy_cc-0.2.0/bench/tasks/rename_refactor/repo/accounts/users.py +11 -0
  32. deputy_cc-0.2.0/bench/tasks/rename_refactor/repo/test_accounts.py +23 -0
  33. deputy_cc-0.2.0/bench/tasks/rename_refactor/task.md +10 -0
  34. deputy_cc-0.2.0/docs/REFERENCE.md +262 -0
  35. deputy_cc-0.2.0/glama.json +4 -0
  36. deputy_cc-0.2.0/integrations/codex/SKILL.md +21 -0
  37. deputy_cc-0.2.0/integrations/codex/config.toml +9 -0
  38. deputy_cc-0.2.0/integrations/cursor/deputy.mdc +21 -0
  39. deputy_cc-0.2.0/integrations/cursor/mcp.json +19 -0
  40. deputy_cc-0.2.0/llms.txt +45 -0
  41. deputy_cc-0.2.0/pyproject.toml +55 -0
  42. deputy_cc-0.2.0/server.json +71 -0
  43. deputy_cc-0.2.0/skills/consult/SKILL.md +22 -0
  44. deputy_cc-0.2.0/skills/delegate/SKILL.md +30 -0
  45. deputy_cc-0.2.0/skills/investigate/SKILL.md +16 -0
  46. deputy_cc-0.2.0/skills/review/SKILL.md +24 -0
  47. deputy_cc-0.2.0/src/deputy/__init__.py +3 -0
  48. deputy_cc-0.2.0/src/deputy/__main__.py +3 -0
  49. deputy_cc-0.2.0/src/deputy/agent.py +363 -0
  50. deputy_cc-0.2.0/src/deputy/cli.py +129 -0
  51. deputy_cc-0.2.0/src/deputy/config.py +243 -0
  52. deputy_cc-0.2.0/src/deputy/diff.py +73 -0
  53. deputy_cc-0.2.0/src/deputy/server.py +304 -0
  54. deputy_cc-0.2.0/src/deputy/setup.py +189 -0
  55. deputy_cc-0.2.0/src/deputy/stats.py +190 -0
  56. deputy_cc-0.2.0/src/deputy/tools.py +335 -0
  57. deputy_cc-0.2.0/src/deputy/workspace.py +59 -0
  58. deputy_cc-0.2.0/tests/conftest.py +71 -0
  59. deputy_cc-0.2.0/tests/test_agent.py +116 -0
  60. deputy_cc-0.2.0/tests/test_config.py +67 -0
  61. deputy_cc-0.2.0/tests/test_review.py +95 -0
  62. deputy_cc-0.2.0/tests/test_server.py +82 -0
  63. deputy_cc-0.2.0/tests/test_setup.py +83 -0
  64. deputy_cc-0.2.0/tests/test_stats.py +77 -0
  65. deputy_cc-0.2.0/tests/test_tools.py +117 -0
Binary file
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "deputy",
3
+ "description": "Deputy: a cheap model reviews Claude's code for bugs and gives second opinions, while Claude stays the lead.",
4
+ "owner": {
5
+ "name": "Amirhossein Alimohammadi",
6
+ "url": "https://github.com/alimohammadiamirhossein"
7
+ },
8
+ "plugins": [
9
+ {
10
+ "name": "deputy",
11
+ "source": "./",
12
+ "description": "DeepSeek V4.1 Flash reviews Claude's code for bugs, gives second opinions and searches code, for under a cent each. Claude keeps writing the code; an optional savings mode delegates coding work."
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "deputy",
3
+ "displayName": "Deputy",
4
+ "version": "0.2.0",
5
+ "description": "Deputize cheap models. Claude stays the sheriff. A cheap model, DeepSeek V4.1 Flash, reviews Claude's code for bugs and gives second opinions, for under a cent each. Claude keeps writing the code; an optional savings mode delegates coding work.",
6
+ "author": {
7
+ "name": "Amirhossein Alimohammadi",
8
+ "url": "https://github.com/alimohammadiamirhossein"
9
+ },
10
+ "homepage": "https://github.com/alimohammadiamirhossein/deputy",
11
+ "repository": "https://github.com/alimohammadiamirhossein/deputy",
12
+ "license": "MIT",
13
+ "icon": "./.claude-plugin/icon.png",
14
+ "keywords": ["subagent", "deepseek", "deepinfra", "mcp", "cost-optimization", "token-savings", "second-opinion", "coding-agent"],
15
+ "mcpServers": {
16
+ "deputy": {
17
+ "command": "uvx",
18
+ "args": ["--from", "${CLAUDE_PLUGIN_ROOT}", "deputy", "serve"],
19
+ "env": {
20
+ "DEPUTY_API_KEY": "${user_config.deepinfra_api_key}",
21
+ "DEPUTY_THINKING": "${user_config.thinking}",
22
+ "DEPUTY_MODE": "${user_config.mode}",
23
+ "DEPUTY_LEAD_MODEL": "${user_config.lead_model}",
24
+ "DEPUTY_WORKSPACE": "${CLAUDE_PROJECT_DIR}"
25
+ }
26
+ }
27
+ },
28
+ "userConfig": {
29
+ "mode": {
30
+ "type": "string",
31
+ "title": "Mode",
32
+ "description": "accuracy (recommended): Claude writes all code, Deputy only gives second opinions and reviews. balanced: Deputy also takes low-risk mechanical work. savings: Deputy takes most coding work.",
33
+ "options": ["accuracy", "balanced", "savings"],
34
+ "default": "accuracy"
35
+ },
36
+ "deepinfra_api_key": {
37
+ "type": "string",
38
+ "title": "DeepInfra API key",
39
+ "description": "Your key from deepinfra.com (Dashboard > API Keys). Stored in your system's secure storage. Leave empty to use the DEEPINFRA_API_KEY environment variable instead.",
40
+ "sensitive": true
41
+ },
42
+ "thinking": {
43
+ "type": "string",
44
+ "title": "Thinking level",
45
+ "description": "How hard DeepSeek thinks. high is the recommended default; max is slower and costs more.",
46
+ "options": ["high", "max"],
47
+ "default": "high"
48
+ },
49
+ "lead_model": {
50
+ "type": "string",
51
+ "title": "Your Claude model (for the savings estimate)",
52
+ "description": "Which Claude model you usually run. Deputy prices its savings estimate against it.",
53
+ "options": ["opus", "sonnet", "haiku", "fable"],
54
+ "default": "opus"
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,25 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ${{ matrix.os }}
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ os: [ubuntu-latest, windows-latest, macos-latest]
18
+ python: ["3.10", "3.12", "3.13"]
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python }}
24
+ - run: python -m pip install -e ".[dev]"
25
+ - run: python -m pytest -q
@@ -0,0 +1,99 @@
1
+ name: Release
2
+
3
+ # Push a tag like v0.2.0 to publish to PyPI and the MCP Registry and create a GitHub release.
4
+ # One-time setup: add a trusted publisher on pypi.org (project deputy-cc, workflow release.yml,
5
+ # environment pypi). No API tokens are stored in the repo.
6
+
7
+ on:
8
+ push:
9
+ tags: ["v*"]
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.12"
22
+ - name: Check the tag matches every version field
23
+ run: |
24
+ tag="${GITHUB_REF_NAME#v}"
25
+ python - "$tag" <<'EOF'
26
+ import json, sys, tomllib
27
+ tag = sys.argv[1]
28
+ found = {
29
+ "pyproject.toml": tomllib.load(open("pyproject.toml", "rb"))["project"]["version"],
30
+ "server.json": json.load(open("server.json"))["version"],
31
+ "server.json package": json.load(open("server.json"))["packages"][0]["version"],
32
+ "plugin.json": json.load(open(".claude-plugin/plugin.json"))["version"],
33
+ }
34
+ bad = {name: version for name, version in found.items() if version != tag}
35
+ if bad:
36
+ sys.exit(f"tag v{tag} does not match: {bad}")
37
+ EOF
38
+ - run: python -m pip install -e ".[dev]" build
39
+ - run: python -m pytest -q
40
+ - run: python -m build
41
+ - uses: actions/upload-artifact@v4
42
+ with:
43
+ name: dist
44
+ path: dist/
45
+
46
+ pypi:
47
+ needs: build
48
+ runs-on: ubuntu-latest
49
+ environment:
50
+ name: pypi
51
+ url: https://pypi.org/p/deputy-cc
52
+ permissions:
53
+ id-token: write
54
+ steps:
55
+ - uses: actions/download-artifact@v4
56
+ with:
57
+ name: dist
58
+ path: dist/
59
+ - uses: pypa/gh-action-pypi-publish@release/v1
60
+
61
+ mcp-registry:
62
+ needs: pypi
63
+ runs-on: ubuntu-latest
64
+ permissions:
65
+ id-token: write
66
+ contents: read
67
+ steps:
68
+ - uses: actions/checkout@v4
69
+ - name: Wait until PyPI serves the new version
70
+ run: |
71
+ for i in $(seq 1 30); do
72
+ curl -sf "https://pypi.org/pypi/deputy-cc/${GITHUB_REF_NAME#v}/json" > /dev/null && exit 0
73
+ sleep 10
74
+ done
75
+ echo "PyPI never showed the new version" && exit 1
76
+ - name: Install mcp-publisher
77
+ run: |
78
+ curl -sL "https://github.com/modelcontextprotocol/registry/releases/download/v1.8.4/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
79
+ - run: ./mcp-publisher login github-oidc
80
+ - run: ./mcp-publisher publish
81
+
82
+ github-release:
83
+ needs: pypi
84
+ runs-on: ubuntu-latest
85
+ permissions:
86
+ contents: write
87
+ steps:
88
+ - uses: actions/checkout@v4
89
+ - uses: actions/download-artifact@v4
90
+ with:
91
+ name: dist
92
+ path: dist/
93
+ - name: Create the release with this version's changelog
94
+ env:
95
+ GH_TOKEN: ${{ github.token }}
96
+ run: |
97
+ version="${GITHUB_REF_NAME#v}"
98
+ awk -v v="$version" 'index($0, "## [") == 1 { found = index($0, "## [" v "]") == 1; next } found' CHANGELOG.md > notes.md
99
+ gh release create "$GITHUB_REF_NAME" dist/* --title "Deputy $version" --notes-file notes.md
@@ -0,0 +1,20 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .venv/
5
+ venv/
6
+ build/
7
+ dist/
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ .mypy_cache/
11
+ .coverage
12
+ htmlcov/
13
+ .env
14
+ .env.*
15
+ .idea/
16
+ .vscode/
17
+ .DS_Store
18
+
19
+ # benchmark transcripts (results.md and results.json are kept)
20
+ bench/results/**/*.jsonl
@@ -0,0 +1,55 @@
1
+ # Changelog
2
+
3
+ All notable changes to Deputy. The format follows [Keep a Changelog](https://keepachangelog.com/),
4
+ and versions follow [Semantic Versioning](https://semver.org/).
5
+
6
+ ## [0.2.0] - 2026-10-24
7
+
8
+ ### Added
9
+
10
+ - **Accuracy mode, now the default.** Claude writes all code itself and uses the cheap model only
11
+ as extra eyes. Delegation happens only on request, or in the new `balanced` and `savings` modes.
12
+ Set it with the plugin option or `DEPUTY_MODE`.
13
+ - **`review` tool.** Independent reviewers, one per lens, check the uncommitted git diff (or a
14
+ given `base`, `paths` or `diff`) with an adversarial prompt. Findings ask for impact, a repro and
15
+ a fix.
16
+ - **`consult` `my_view`.** Records Claude's conclusion before it sees the helper's ideas; it is
17
+ never sent to the model.
18
+ - `/deputy:review` skill, a mode-aware delegate skill, the `SKILL.md` playbook and
19
+ `docs/REFERENCE.md`.
20
+ - PyPI package [`deputy-cc`](https://pypi.org/project/deputy-cc/): run `uvx deputy-cc serve` in
21
+ any MCP client.
22
+ - Official MCP Registry entry (`io.github.alimohammadiamirhossein/deputy`), `llms.txt`, and a
23
+ benchmark harness in `bench/`.
24
+ - **Savings estimate.** Each result ends with a rough "this work would cost $X on your lead model;
25
+ Deputy did it for $Y" line. The new `stats` tool and `deputy stats` command show totals for the
26
+ session, today, the last 7 days and all time; reviews and second opinions are listed as extra
27
+ checks, never as savings. Set the lead model with `DEPUTY_LEAD_MODEL` or the plugin option. The
28
+ log stores numbers only.
29
+ - **Cursor and Codex support.** `deputy setup cursor` and `deputy setup codex` add Deputy to the
30
+ editor's MCP config (with a backup) and install the playbook as a Cursor rule or Codex skill;
31
+ Codex gets a 30-minute tool timeout. Copy-paste files are in `integrations/`.
32
+ - **Workspace detection for any client.** Deputy asks the client for its project folder (MCP
33
+ roots), and every tool accepts `project_dir`, so it works when an editor starts it outside the
34
+ project.
35
+
36
+ ### Changed
37
+
38
+ - Server instructions now depend on the mode.
39
+ - Prompts include today's date, and APIs the model doesn't know are marked `[unverified]`.
40
+ - Shorter README with measured costs and a "when to use, and when not to" section.
41
+
42
+ ## [0.1.0] - 2026-10-23
43
+
44
+ ### Added
45
+
46
+ - First release: an MCP server and Claude Code plugin that runs DeepSeek V4.1 Flash on DeepInfra
47
+ (thinking `high`) as a helper.
48
+ - `delegate` (coding sub-agent with its own tool loop), `investigate` (read-only search),
49
+ `consult` (parallel second opinions) and `status`.
50
+ - Workspace jail, read-only tool sets, secret-free shell environment, and limits on turns, tokens
51
+ and time.
52
+ - `deputy doctor` to check the key, the endpoint and that thinking is on.
53
+
54
+ [0.2.0]: https://github.com/alimohammadiamirhossein/deputy/compare/2347242...v0.2.0
55
+ [0.1.0]: https://github.com/alimohammadiamirhossein/deputy/commit/2347242
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Amirhossein Alimohammadi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,232 @@
1
+ Metadata-Version: 2.5
2
+ Name: deputy-cc
3
+ Version: 0.2.0
4
+ Summary: 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.
5
+ Project-URL: Homepage, https://github.com/alimohammadiamirhossein/deputy
6
+ Project-URL: Repository, https://github.com/alimohammadiamirhossein/deputy
7
+ Project-URL: Issues, https://github.com/alimohammadiamirhossein/deputy/issues
8
+ Project-URL: Changelog, https://github.com/alimohammadiamirhossein/deputy/blob/main/CHANGELOG.md
9
+ Author: Amirhossein Alimohammadi
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: agentic-coding,ai-agent,ai-code-review,anthropic,claude,claude-code,claude-code-plugin,code-review,coding-agent,cost-optimization,deepinfra,deepseek,deepseek-v4,llm,mcp,mcp-server,model-context-protocol,second-opinion,subagent,token-savings
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Topic :: Software Development
25
+ Requires-Python: >=3.10
26
+ Requires-Dist: mcp<2,>=1.20
27
+ Requires-Dist: openai<3,>=1.40
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ <div align="center">
33
+
34
+ <!-- mcp-name: io.github.alimohammadiamirhossein/deputy -->
35
+
36
+ <img src="https://raw.githubusercontent.com/alimohammadiamirhossein/deputy/main/.claude-plugin/icon.png" alt="Deputy sheriff badge logo" width="128" height="128">
37
+
38
+ # Deputy
39
+
40
+ ### Deputize cheap models. Claude stays the sheriff.
41
+
42
+ **Deputy is a Claude Code plugin and MCP server that has a cheap model, DeepSeek V4.1 Flash, review
43
+ Claude's code for bugs and give second opinions, for under a cent each. Claude keeps writing the
44
+ code.**
45
+
46
+ [![GitHub stars](https://img.shields.io/github/stars/alimohammadiamirhossein/deputy?style=social)](https://github.com/alimohammadiamirhossein/deputy/stargazers)
47
+ [![CI](https://github.com/alimohammadiamirhossein/deputy/actions/workflows/ci.yml/badge.svg)](https://github.com/alimohammadiamirhossein/deputy/actions/workflows/ci.yml)
48
+ [![PyPI](https://img.shields.io/pypi/v/deputy-cc.svg)](https://pypi.org/project/deputy-cc/)
49
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/alimohammadiamirhossein/deputy/blob/main/LICENSE)
50
+ [![MCP](https://img.shields.io/badge/protocol-MCP-purple.svg)](https://modelcontextprotocol.io/)
51
+
52
+ </div>
53
+
54
+ ```bash
55
+ claude plugin marketplace add alimohammadiamirhossein/deputy
56
+ claude plugin install deputy@deputy
57
+ ```
58
+
59
+ Inside Claude Code the same thing is `/plugin marketplace add alimohammadiamirhossein/deputy`.
60
+ You need [uv](https://docs.astral.sh/uv/getting-started/installation/) and a
61
+ [DeepInfra API key](#quick-start).
62
+
63
+ ## What it costs (measured)
64
+
65
+ | Run | Time | Cost |
66
+ |---|---|---|
67
+ | `review`: two reviewers check a change with a planted off-by-one bug (both caught it) | 27 s | **$0.0011** |
68
+ | `consult`: second opinions from 2 angles | 68 s | **$0.0018** |
69
+ | `investigate`: list a project's functions and their tests | 18 s | **$0.0004** |
70
+ | `delegate`: fix a bug, add 3 tests, run pytest until green | 46 s | **$0.0006** |
71
+
72
+ Measured on a small demo project with thinking `high`. On real projects, expect `consult` and
73
+ `review` to stay under $0.01. Every result shows its real tokens and cost.
74
+
75
+ ## What it does
76
+
77
+ Claude (for example Opus 5.5) stays in charge and **writes the code**. Deputy adds four tools that
78
+ run a much cheaper model as a helper inside your project:
79
+
80
+ | Tool | What it does |
81
+ |---|---|
82
+ | **`review`** | Independent reviewers hunt for bugs in Claude's change before it calls the task done |
83
+ | **`consult`** | Second opinions from 2–4 angles at once, before Claude commits to a plan |
84
+ | **`investigate`** | Reads lots of code and returns `file:line` leads |
85
+ | **`delegate`** | Hands a coding task to the cheap model (off by default; on request, or in savings mode) |
86
+ | **`stats`** | Shows roughly how many tokens and dollars Deputy saved: this session, today, this week, all time |
87
+
88
+ Claude treats everything Deputy says as an **unverified hint**: it checks each finding against
89
+ the code and keeps only what holds up.
90
+
91
+ ### See what you saved
92
+
93
+ Every result ends with a one-line estimate, for example from a real `investigate` run:
94
+
95
+ ```text
96
+ 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.
97
+ ```
98
+
99
+ Ask Claude for `stats`, or run `deputy stats`, for totals. Reviews and second opinions are listed
100
+ separately as extra checks, so they never inflate the savings. The estimate assumes your lead
101
+ model would use about as many tokens, so treat it as an order of magnitude. Only numbers are
102
+ stored, never code or prompts. Set your lead model with `DEPUTY_LEAD_MODEL` (`opus`, `sonnet`,
103
+ `haiku`, `fable` or `custom`).
104
+
105
+ ## When to use Deputy, and when not to
106
+
107
+ **Use it for:**
108
+
109
+ - Non-trivial changes where a missed bug costs more than a cent: logic, edge cases, refactors that
110
+ touch several files.
111
+ - A second opinion before Claude commits to a design, without spending Claude tokens on it.
112
+ - Wide reading in a big codebase, such as "where is this setting read?".
113
+ - Well-specified mechanical work (boilerplate, renames, test scaffolding) in `balanced` or
114
+ `savings` mode, when you want to save Claude tokens.
115
+
116
+ **Skip it for:**
117
+
118
+ - Trivial edits like typos and one-liners. A review takes 30–60 seconds and adds little there.
119
+ - Code you may not share with a third party. Deputy sends code to DeepInfra, or to whatever
120
+ endpoint you set in `DEPUTY_BASE_URL` (a local model works too).
121
+ - Final answers. Findings come from a weaker model and include false positives, which is why
122
+ Claude verifies every one.
123
+ - Architecture and security-sensitive decisions in `savings` mode. Keep those with Claude.
124
+
125
+ ## Quick start
126
+
127
+ **1. Get a DeepInfra API key** (DeepInfra hosts DeepSeek's models in the US)
128
+
129
+ 1. Sign up at **[deepinfra.com](https://deepinfra.com/)** with GitHub, Google or email.
130
+ 2. In **Dashboard → Billing**, add a card and **$5–10** of credit, then set a **spending limit**
131
+ equal to that amount.
132
+ 3. In **API Keys**, create a key (it starts with `sk-di-`) and copy it. Keep it private.
133
+
134
+ You don't need a plan, a model purchase or a dedicated GPU. Pay-as-you-go credit is enough.
135
+
136
+ **2. Install** [uv](https://docs.astral.sh/uv/getting-started/installation/) and the plugin
137
+
138
+ ```bash
139
+ claude plugin marketplace add alimohammadiamirhossein/deputy
140
+ claude plugin install deputy@deputy
141
+ ```
142
+
143
+ Claude Code asks for your DeepInfra key and stores it in your system's secure storage.
144
+
145
+ **3. Restart Claude Code and try it**
146
+
147
+ ```text
148
+ /deputy:review
149
+ /deputy:consult I plan to cache sessions in Redis. What am I missing?
150
+ /deputy:investigate how does a request reach the database?
151
+ ```
152
+
153
+ Or just work normally: Claude consults and reviews on its own for non-trivial tasks.
154
+
155
+ ### Cursor and Codex
156
+
157
+ One command adds Deputy to the editor's MCP config (with a backup of the old file) and installs
158
+ the playbook as a Cursor rule or Codex skill:
159
+
160
+ ```bash
161
+ uvx --from git+https://github.com/alimohammadiamirhossein/deputy deputy setup cursor --project .
162
+ uvx --from git+https://github.com/alimohammadiamirhossein/deputy deputy setup codex
163
+ ```
164
+
165
+ Set `DEEPINFRA_API_KEY` in your environment first, then restart the editor. Add `--dry-run` to
166
+ see the changes without writing them. Ready-made files are in
167
+ [integrations/](https://github.com/alimohammadiamirhossein/deputy/tree/main/integrations).
168
+
169
+ ### Other MCP clients (Cline, Windsurf, Claude Desktop)
170
+
171
+ Deputy is on PyPI as [`deputy-cc`](https://pypi.org/project/deputy-cc/). Add a stdio MCP server
172
+ that runs:
173
+
174
+ ```bash
175
+ uvx deputy-cc serve
176
+ ```
177
+
178
+ with `DEEPINFRA_API_KEY` set in its environment. Check your setup with `uvx deputy-cc doctor`.
179
+
180
+ ## Recommended model: DeepSeek V4.1 Flash, thinking `high`
181
+
182
+ The default is `deepseek-ai/DeepSeek-V4.1-Flash-1017` on DeepInfra with thinking set to `high`.
183
+ It's the best price-to-quality option we found for this job:
184
+
185
+ - **Cheap:** $0.098 per 1M input tokens and $0.294 per 1M output tokens (October 2026), cheaper
186
+ than DeepSeek's own API.
187
+ - **Capable:** about 1M tokens of context and reliable tool calling.
188
+ - **Thinking actually on:** DeepInfra leaves its thinking **off** unless asked. Deputy always asks
189
+ (`high`), which we confirmed by measuring the reasoning tokens.
190
+ - **Private:** DeepInfra says it doesn't train on your data. Your code isn't sent to DeepSeek's
191
+ own servers.
192
+
193
+ ## Modes
194
+
195
+ | Mode | Who writes the code | Pick it when |
196
+ |---|---|---|
197
+ | **accuracy** (default) | Claude, always | You want the best result |
198
+ | **balanced** | Claude; Deputy takes boilerplate | You want some savings without risk |
199
+ | **savings** | Deputy, Claude verifies | You want to save the most tokens |
200
+
201
+ Change it in the plugin settings (`/plugin`) or with `DEPUTY_MODE`.
202
+
203
+ ## Learn more
204
+
205
+ - **[SKILL.md](https://github.com/alimohammadiamirhossein/deputy/blob/main/SKILL.md)**: the
206
+ playbook Claude follows (consult → decide → implement → review → check each finding). Also works
207
+ without the plugin.
208
+ - **[docs/REFERENCE.md](https://github.com/alimohammadiamirhossein/deputy/blob/main/docs/REFERENCE.md)**:
209
+ all settings, costs, safety, terms of service, the research behind the design, troubleshooting
210
+ and the roadmap.
211
+ - **[CHANGELOG.md](https://github.com/alimohammadiamirhossein/deputy/blob/main/CHANGELOG.md)**:
212
+ what changed in each release.
213
+
214
+ Deputy stays within Anthropic's rules: Claude Code runs unmodified, and Deputy never touches your
215
+ Claude login. It's an ordinary MCP tool using your own DeepInfra key.
216
+
217
+ ## Support the project
218
+
219
+ If Deputy caught a bug for you, **[give it a ⭐](https://github.com/alimohammadiamirhossein/deputy/stargazers)**
220
+ and share it with someone who uses Claude Code. Issues and pull requests are welcome; the
221
+ [good first issues](https://github.com/alimohammadiamirhossein/deputy/labels/good%20first%20issue)
222
+ are a good place to start.
223
+
224
+ [![Star History Chart](https://api.star-history.com/svg?repos=alimohammadiamirhossein/deputy&type=Date)](https://star-history.com/#alimohammadiamirhossein/deputy&Date)
225
+
226
+ ---
227
+
228
+ [MIT](https://github.com/alimohammadiamirhossein/deputy/blob/main/LICENSE) © 2026 Amirhossein
229
+ Alimohammadi · Not affiliated with Anthropic, DeepSeek or DeepInfra.
230
+
231
+ <sub>Keywords: Claude Code plugin, MCP server, Model Context Protocol, AI code review, second
232
+ opinion, DeepSeek V4.1 Flash, DeepInfra, subagent, Opus, agentic coding, reduce Claude Code cost.</sub>