Skip to content
Muhammet Şafak
tr
Cover — a laptop showing commitbrief diff --local above a panel reading 'LOCAL DIFF REVIEW: Analysis complete. (Model: Ollama/Llama2)', with a local_inference folder beside

Local code review without letting the diff leave the machine

How a provider-agnostic Go CLI reviews a diff without it leaving the machine, and how the experiment reached signed binaries as CommitBrief.

What it does today

Reviews code locally, with the diff never leaving the machine; the `Provider` interface lets Anthropic, OpenAI, Gemini and Ollama plug into one contract. Signed binaries are published — anyone who does not want to hand their diff to a cloud provider can install it.

Started
January 2026 — April 2026
Left Labs

Form

Open-Source

Technologies

Go Cobra go-git Anthropic Claude OpenAI Google Gemini Ollama

This one became a product:

CommitBrief

You do not have to let the diff leave the machine to have a model read it. The one outbound call goes to the provider you picked — and the real work is in making that provider pluggable.

A review that never leaves the terminal

The problem was this: before a code change goes to another person (or to my future self), it should be possible to get a structured “second pair of eyes” review without leaving the terminal. The diff should not leave the machine, and neither should the review.

What fits in one command

The scope fit into a single command: staged diff, one commit, the working tree, or a PR-style three-dot range. Project rules can be customised through COMMITBRIEF.md, and the output can be produced as a coloured terminal card, as markdown or as a strict JSON schema.

Making the provider pluggable

The shortest-lived part of an LLM tool is the provider it talks to. Two decisions came out of that assumption.

Provider is a registry in the database/sql style. Calling the provider directly would have been the shortest path; you pay for that path with the second provider. With a registry, adding a new provider means one package and one blank import. Anthropic, OpenAI, Gemini and Ollama are API-based; claude-cli and gemini-cli are subprocess-based providers that reuse the user’s existing subscription — all of them implement the same interface.

Git is not read through one path. go-git is pure Go and needs no installation; it covers every commit-based operation, plus status and diff. Its coverage ends at the edges of the working tree: add is supported only in its plain form, and multiple worktrees and index v1/v3 are not supported at all. The pure solution would have been to never fall back to the binary, and then every one of those edges would have been a blind spot for the tool. A hybrid path was chosen: go-git first, the git binary beyond its coverage, both behind the same Repo interface.

Not paying twice for the same diff

The third decision is about cost. An LLM call is billed, and a developer has the same diff reviewed several times a day — before the commit, after the fix, when opening the PR.

If the cache key were the diff alone, the cache would return the wrong answer: the same diff under a different provider, model or language is a different review. So the key has five parts — diff, system prompt, provider, model and language — hashed with SHA256. When the same five arrive again, the call drops to a single disk read, and each call reports what it saved on a Saved: $X line.

The same discipline applies to what gets sent: a three-layer filter narrows what reaches the model — built-in defaults, .commitbriefignore and the semantic filter in COMMITBRIEF.md. “The diff never leaves the machine” meant this; what does leave is also something you choose.

The road to signed binaries

The Labs stage is closed: CommitBrief is now a product with its own domain, signed binaries and a release contract. Details in the portfolio.

Tags: #ai#cli#code-review
Share:

More Records

All records

A self-hosted Go gateway holds the provider keys and injects RAG context, so the application talks to one OpenAI-compatible endpoint.

What it does today

Lets an application talk to one OpenAI-compatible endpoint while a project's configuration decides which model the request reaches and, when a document store is linked, which documents it draws context from. Anyone who does not want provider keys spread across applications, and wants spend capped per project, can run it on their own server.

Open-Source Web Go PostgreSQL pgvector +8 more
August 2026 — September 2026

A desktop app that reads Claude Code, Codex CLI and Gemini CLI logs locally and shows token usage by project, model and session.

What it does today

Collects AI agent token usage from local logs and shows it by project, model, session and time, with estimated cost and subscription limit tracking. A developer who uses Claude Code, Codex CLI or Gemini CLI heavily and wants to see the spend can install it.

Open-Source Desktop Go Wails Svelte +2 more
November 2026 — Ongoing

A CLI that solves a problem repeatedly in isolated sessions and measures how diverse the solution paths are, with JSON and HTML reports. Not on PyPI.

What it does today

Has a model solve the problems of a suite YAML repeatedly in isolated sessions, measures how diverse the solution paths are and how much accuracy drops when a problem is changed on the surface, writes a JSON and HTML report per problem and fails CI on suspected memorization. Engineers choosing a model or checkpoint, or producing fine-tuning data, can clone the repository and install it with uv; it is not on PyPI.

Open-Source Python Typer Pydantic +3 more
November 2026 — Ongoing

Search the site

Start typing to search posts, projects and pages.

Esc to close Powered by Pagefind