Skip to main content
Glama

deputy

Your frontier model plans and reviews. A cheaper model does the long reading and the code changes that tests can check. Code checks every result.

CI Docs OpenSSF Scorecard OpenSSF Best Practices License: Apache-2.0

deputy is an MCP server that lets your coding agent (Claude Code, or any MCP client) keep its tokens for planning and review. It takes two kinds of work off the frontier model:

  • Code changes that tests or linters can check. A local agent makes them on your own model (llama.cpp), in a private copy of the repository, one change per short conversation, until the project's checks pass. Your agent gets a patch to review and apply.

  • Long reading. "Summarise this 900-line document", "what changed in the last ten commits, and why": a cheaper model (local, or any OpenAI-compatible API) reads, code proves every quoted line, and your agent reads a short answer, not the files.

Status: alpha, in daily use. It works end to end, is tested and measured on real repositories, and is used to develop a real multi-app project. Expect breaking changes. Verified with Claude Code; GitHub Copilot, Cursor and Codex are configured by the installer but not yet verified. The local agent needs Claude Code.

When it pays, and when it does not

Hand over

Do it yourself

Code changes you can state and check: a list of small changes with their tests, removals, renames, mechanical edits across files

A change of a few lines you are waiting for: a local model takes minutes where a hosted one takes seconds

Long reads: summaries, inventories, cross-references, facts with their lines

A change that needs analysis nobody has done yet: on a real issue the local model did the mechanical steps and not the hard one

Big logs and test output (summarise_log)

Lookups in a short file or one line (deputy flags these as small_input), and code you are about to edit

Questions about git history (git log, diff, show, blame)

Searches that only list files: you would see the same list

What was measured, with its limits, is on the evidence page. In short:

  • Code changes. Eight small changes to this repository (code, tests and documentation each): Claude Sonnet 5.5 alone spent about 137,000 weighted tokens in 2.5 minutes; handing them to Qwen3.8 27B in eight steps it spent 77,660, about 43 % fewer, and waited 88 minutes. Both results passed the tests, the linter, the formatter and the type checker. One run, on a laptop.

  • Reading. On 21 everyday tasks on two real repositories, run twice with a local 27B worker, every answer was correct, confirmed by a frontier model reading the files. Reading tasks saved about 4,800 to 5,600 frontier tokens each; lookups and searches saved about nothing.

  • Where your tokens really go. On one real project the large reads were at most 7 % of what the sessions spent, the subagents that edit code 43 %, and reading again a context above 200,000 tokens 38 %. deputy discover prints the same table for your own sessions, so you know which of the three is worth your time.

Related MCP server: DZ23 Subagents Universal MCP

Quick start

curl -LsSf https://raw.githubusercontent.com/tommasomarchionni/deputy/main/install.sh | sh
deputy init                               # point it at your model server
deputy doctor                             # check that it answers, and what the local agent can use
deputy install claude-code --apply        # once: the MCP server, the skill and the hints

For Claude Code that one command does everything, for every project: it registers the MCP server, installs the skill that teaches the agent when to delegate (~/.claude/skills/deputy/, loaded only when relevant, kept current by deputy on each update), and adds two hints: one line before a large read, and a few lines with each request that send checkable code changes to the local agent, so you do not have to ask for it (deputy hook off turns both off; code_changes = "frontier" in the configuration leaves code changes to your agent's choice). Codex: deputy install codex --apply keeps its guide current too. Copilot and Cursor read the guide from files in the project: deputy install vscode|cursor --apply, then deputy instructions --for copilot|cursor --apply in each project (deputy doctor says when a copy needs refreshing).

The local agent needs the claude command, a git repository and a llama.cpp server whose context holds at least 110,000 tokens (--ctx-size 131072); what else to set on the server is in install.

deputy keeps itself current: a newer compatible release is installed when the server starts, only after its build provenance is verified, never a new major version or a release marked as breaking (auto_update in the configuration; notify or off to opt out). A session that is already open keeps the version it started with until you reconnect the server (in Claude Code: /mcp).

How it works

A code change (delegate with agent=true):

  1. Your agent writes what the changes share in task, one change per item of steps, and the project's own test and lint commands as checks. It does not read the code first.

  2. deputy copies the repository (a git worktree, with your uncommitted changes to tracked files) and runs Claude Code's own agent loop on your local model, confined to that copy: its file tools cannot leave it, and its shell has no network, cannot read your keys and writes only there. Each step gets a conversation of its own.

  3. The checks run on the copy. Failures go back to the local agent, up to three times. A step it cannot do is undone, its draft is kept apart, and the answer names it.

  4. Your agent waits with deputy wait <run_id> (one turn, no polling), reads the patch, applies it with git apply, and does only what was left.

A question about files (digest, or delegate with your own checks):

  1. Your agent names the files and the question; deputy adds the checks (every quoted line must be in that file at that line), or you declare them: contain these facts, stay under 1,500 characters, pass this command.

  2. The worker reads inside that folder only. It has no shell, no network and cannot read secret-looking files. Its tools: read_file, write_file, grep, list_files, read-only git, summarise_log (a model-free summary of a big log) and scan_file (a file larger than the model's context, read in parts).

  3. The server runs the checks. A failing answer gets one correction round; if it still fails, the result says needs_frontier and your agent does the task itself.

Either way the result is short: status, answer, a one-line check summary, and files or flags only when there are any.

Commands

Command

What it does

deputy init, deputy doctor

write a starter configuration; check it, the backends and what the local agent can use

deputy install, deputy instructions

connect an agent; print or write the delegation guide

deputy hook on|off|status

the Claude Code hints

deputy wait RUN_ID

wait for a local agent's run and print its result

deputy discover

where your agent's reading and tokens went in past Claude Code sessions, and how much a delegation could take

deputy stats

what deputy did for you: runs, pass rate, tokens saved, per kind of task

deputy bench

your model on the built-in suite, or your own tasks with --tasks-file; --compare A.json B.json compares two runs

deputy tune

measure, then recommend or apply request settings that measure better

deputy update

check for a newer release and upgrade

Documentation

Full site: https://tommasomarchionni.github.io/deputy/ (source in docs/).

Topic

Page

Install and connect an agent

install

Configuration, backends, routing, updates

configuration

The tools, the local agent, the checks and the flags

tools

Security model

security

Measured results

evidence

Benchmark, tuning and where your tokens go

self-improvement

Design, state, local model speed

architecture, memory, local serving

Roadmap

roadmap and the project board

Works well with rtk

rtk shortens the output of shell commands your agent runs (git, test runners); deputy takes long reads and checkable code changes off your agent. They do not overlap, and measured numbers for both are on the evidence page.

Contributing

See CONTRIBUTING.md and the Code of Conduct. Report security issues privately: SECURITY.md.

License

Apache-2.0, see LICENSE and NOTICE.

Available Tools

5 tools
collectC

Result of a background delegation (waits 20 s); cancel=True stops it.

Inputs: run_id (required), cancel.

delegateA

Run a task on a worker in the absolute workdir, verified by checks. wait=False: then collect. agent=True: a local agent changes code in a private copy and returns a patch; one change per item of steps, what they share in task.

Inputs: task (required), workdir (required), wait, agent, +5 more. Returns: What the orchestrator reads: the answer and the verdict.

digestB

Ask about files in the absolute workdir instead of reading them: every line of the answer cites a proven file line.

Inputs: files (required), workdir (required), question (required).

feedbackC

Report whether a result was good.

Inputs: run_id (required), verdict (required), reason.

statusC

Backends and whether they answer.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 5 tools

    Disambiguation4/5

    Each tool maps to a distinct role: delegate launches work, collect retrieves background results, digest interrogates files, status checks backends, feedback records quality. The only soft boundary is delegate (agent=True produces a patch) vs. digest (reads files with citations), both of which operate on `workdir` and could be confused by an agent wanting to inspect code rather than change it. Descriptions mostly resolve that edge case.

    Naming Consistency4/5

    Names form a tidy set of single lowercase words with no casing or style drift. The mix of verbs (delegate, digest, collect) and nouns (status, feedback) is a minor deviation from a pure verb_noun convention but stays readable and predictable.

    Tool Count5/5

    Five tools is a tight, well-scoped surface for a delegation/worker server. Each tool has a distinct lifecycle role (launch, retrieve, cancel, inspect, verify, health-check) with no filler.

    Completeness4/5

    The core loop is covered: launch a task, optionally background it, collect or cancel, verify via checks, digest files, check backend health, and give feedback. Gaps are minor but real—there is no way to enumerate or manage multiple concurrent delegations, inspect past results after collection, or list available workers/backends individually.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables users to delegate text and code tasks across multiple AI models with automatic failover, maintain shared mission memory and checkpoints across MCP harnesses, and coordinate parallel role-based subagents. It also supports model discovery, provider inventory, health checks, and stdio/HTTP tool access while leaving patches and tests to the harness.
      24
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      An MCP execution layer that lets capable AI models safely control a developer workstation for file edits, terminal and process execution, Git operations, language-server analysis, browser and Windows UI automation, media processing, job/resource control, and checkpointing. It also coordinates durable single- or multi-agent tasks across providers with leases, dependency graphs, evidence logs, repair loops, and separate verification gates.
      128
      1
      ISC
    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude to delegate bounded, isolated units of work to external LLMs such as Z.AI GLM or any OpenAI-compatible endpoint, running single or up to 16 concurrent workers in separate tool-less workspaces. Results come back through normalized MCP tools that list models, launch, poll, cancel, and clean up agents without exposing credentials or leaking worker output as instructions.
      8
      1
      MIT