Claude plans. Your GPU writes the code.

localexec is a local MCP server for Claude Code. It passes small, precisely specified coding tasks to a model running in Ollama on your machine, checks the result with your own tests and linters, and returns a short verdict instead of a diff.

See a task run in 21 seconds

One real task from spec to verdict: Claude writes the brief, a local model makes the edit, your checks decide, and Claude gets a few lines back instead of a diff.

The video shows: Claude sends a spec for calc.py; the local model changes a - b to a + b; tests, linters and size limits pass; the result returned to Claude is a short JSON verdict. It ends with the install command.

How a task runs

  1. Claude writes a specA short brief: the goal, the files, exact signatures, edge cases and the checks that must pass.
  2. localexec builds the promptIt adds the files to edit, any context you named and your project conventions, within the model's context budget.
  3. The local model replies with editsOllama returns search-and-replace blocks. If they do not parse or match, they are sent back for repair. Nothing is written until every block applies.
  4. Your checks runTests, linters and the size limits run on the result. A failure goes back to the model, up to the attempt limit.
  5. Claude gets a verdictOne short result: status, files changed and a reason. The full diff and logs wait in .localexec/ until someone asks.

What you get

The model runs on your machine

Code is written by a model in Ollama. localexec needs no API key and makes no network calls except to your Ollama server.

Your checks decide

A task passes when your tests, linters and type checks pass, not when the model sounds sure. You configure them per project in one file.

Results stay short

Claude receives a verdict of a few lines. Reading a diff costs tokens only when a task fails or you want to review it.

Edits are atomic and reversible

Every block must apply or nothing is written. Each task keeps backups, so revert_task restores files exactly.

Files stay small

Optional standards fail a change that leaves a function over 50 code lines or a file over 500, so generated code stays reviewable.

It never commits

Changes stay in your working tree for you to review. localexec reads git status and never touches your history.

Eight tools

Claude calls these over MCP. The first three change your project. The rest only read.

ToolWhat it does
implement_taskGives one small task to the local model, applies its edits, runs your checks and retries on failure.
run_checksRuns the configured checks and returns pass or fail per check.
revert_taskUndoes a task: restores changed files and removes files it created.
list_tasksLists recent tasks, one short line each. Use it after losing context.
show_patchSkims a task's diff cheaply, with a line cap.
statusChecks that Ollama is reachable, the model is installed and the config is valid.
outlineLists a file's functions, classes and methods with line ranges.
findSearches the project with a regular expression.

Read the tool reference

Hold generated code to a size limit

Turn on the standards check and every task is measured. A function over 50 code lines fails, and the model is asked to extract helpers. A file over 500 lines fails and goes back to Claude, because splitting a file is a planning decision, not a retry.

Read about coding standards

Function length

fails above 50

File length

warns above 300fails above 500

Start in three steps

  1. Install the server and create the model. You need uv, git and Ollama. The guide has the two-line Modelfile.

    uv sync
    ollama create qwen-coder-16k -f Modelfile
  2. Describe your checks. Copy .localexec.example.json into your project as .localexec.json and list the commands that must pass.

  3. Register it with Claude Code.

    claude mcp add --scope user localexec -- uv run --project <install-dir> localexec-mcp

Open the full guide