The missing layer of agentic coding

AI agents that already know your codebase.

Your team already made the hard calls — patterns to prefer, approaches to avoid, edge cases that bite. Metatron captures them as decision files versioned in git, consulted by any coding agent before it writes a line — so agents follow your conventions instead of guessing. Agents propose what they learn; your pull-request review decides what becomes canonical. Prefer a serving layer? The same decisions ship over MCP.

Open-source · Self-hosted tree-sitter parsing Official MCP SDK SQLite · Python 3.12+
See it in action

Watch Metatron in two minutes.

From a cold codebase to agents that write to your conventions — extraction, human curation with an AI judge, an agent consuming decisions over MCP, and the feedback loop that makes the next agent smarter.

The problem

AI agents are confident strangers.

They've never read your codebase. They don't know you abandoned that pattern two years ago, that this service has a hard rule about retries, or that auth means three different things in three different repos. So they generate plausible code that quietly ignores everything your team learned the hard way.

01

Reinvents what you rejected

Reaches for the library you dropped, the pattern you deprecated, the abstraction the team voted down in review.

02

Ignores the edge cases

Doesn't know which call must be idempotent, which path is hot, or which input you've been burned by before.

03

Drifts from your conventions

Right on its own, wrong for you. Every PR becomes a re-litigation of decisions you already settled.


How it works

A loop, not a one-time import.

Metatron ingests your repo and git history with tree-sitter, distills candidate decisions, and serves only what a human has curated. As agents work, they report what was missing — and those gaps return as new candidates. The canonical set is never automatic.

Source

Your codebase

Your repositories, local paths, and git commit history.

Ingest

Parse & extract

Runs tree-sitter to collect deterministic facts and LLM to infer decisions.

Candidates

Candidate decisions

Bootstrapped from your code & git with tree-sitter. Proposed — never yet trusted.

Human gate

Curation review

A person approves, edits, or rejects. Always required.

Canonical

Trusted decisions

Approved by a human — the only decisions agents follow. Versioned in git (files-first) or SQLite (MCP mode), on your own infra.

Consult · files or MCP

Live context

Read straight from git by any agent — or served over MCP, on demand.

Output

Senior-level code

The agent writes to your conventions — first try.

Feedback

↺ Back to Metatron

Agents author what they learned as decision files on a branch (files-first) or call submit_feedback() over MCP — either way it returns as a proposal for human review. Never auto-applied.

Each side carries candidate decisions forward — but only past the human gate do they become canonical.
The accent edge closes the loop: agents propose what they learned — a decision file on a branch, or submit_feedback() over MCP — and it comes back as a candidate. Still curated, never auto-applied.

See it

Curate the set. Watch agents put it to work.

A local web UI over the same store the CLI uses: review candidates into the canonical set, then see which agents query it, what they were served, and where they hit a gap. Bound to localhost — your decisions never leave your machine.

Metatron's local curation UI — the Agent Impact view: live agent activity, query coverage, and decisions served.
The Agent Impact view — live agent activity, query coverage, and decisions served.

Anatomy of a decision

A decision is a record, not a paragraph.

Wikis rot. Style guides get ignored. A Metatron decision is a typed, queryable record an agent can actually reason over — with the rationale and the receipts attached.

  • patternthe rule, stated precisely
  • scopewhere it applies — paths, layers, contexts
  • rationalewhy it exists — the decision behind it
  • confidencehow strongly it's held, 0–1
  • source_refsPRs, incidents, ADRs that prove it

Tap the card to see the raw record →

decision · #0427 canonical
Outbound GETs must be idempotent & retried
scope: services/api/** · outbound HTTP to internal services
confidence0.92 · high
decision_0427.json structured
{
  "pattern": "wrap outbound GET in
              @with_retry(policy='idempotent')",
  "scope": "services/api/**",
  "context": "outbound HTTP, internal mesh",
  "rationale": "GETs are safe to retry; flaky
              mesh caused 0.3% phantom 5xx",
  "confidence": 0.92,
  "source_refs": ["PR#3120", "inc/2025-11-08", "ADR-017"],
  "curated_by": "@dlin",
  "status": "canonical"
}
Before / after

Same task. One agent has read the decisions.

services/api/users.py convention violations
1import requests # ad-hoc client
2
3def fetch_user(user_id):
4 r = requests.get(f"{API}/users/{user_id}")
5 if r.status_code != 200:
6 return None # error vanishes
7 return r.json() # untyped dict
decision #0427Ignores the sanctioned internal.http client and the documented retry policy. Failures collapse into None instead of propagating.
1from internal.http import client
2from internal.types import Result, User
3
4@with_retry(policy="idempotent") # decision #0427
5def fetch_user(user_id: str) -> Result[User]:
6 resp = client.get(f"/users/{user_id}")
7 return resp.parse(User) # typed, errors propagate
decision #0427Uses the sanctioned client, the team's Result[T] error model, and the documented retry policy. No guessing — it read the record.

Trust by design

Self-hosted. Structured. Human-curated.

The whole point is a knowledge set you can trust enough to act on. That requires three non-negotiables.

Runs on your infra

Self-hosted by default. Metatron parses your private code in place. Nothing — not a line, not an embedding — leaves your network. On-prem or your own cloud, your call.

Structured, not prose

Every decision is a typed record with scope, rationale, confidence and source refs. Queryable, diffable, reviewable in a PR. No wikis to rot, no vibes to misread.

Human-in-the-loop

No decision self-promotes. A candidate stays a candidate until a person curates it into the canonical set. You decide what the agents are allowed to trust.

Interop

Your decisions, in git — and in the Open Knowledge Format.

Rather live in files and your agent than click around a UI? Mirror every decision to plain markdown in your own repo. The bundle is a valid Open Knowledge Format (OKF) bundle — auditable in git, editable with your agent, portable to any tool that reads the standard.

Git is the audit trail

Status lives in the directory: candidate/ and decisions/. Promote a decision with a git mv, review it in a PR, blame any line. The canonical boundary stays human-gated.

Edit as files, not a screen

Open a decision and change the pattern or rationale — or ask your coding agent to. mirror import applies human edits back; machine-derived fields stay read-only, so nothing gets clobbered.

A portable OKF bundle

Each decision is an OKF concept — markdown with YAML frontmatter, no SDK, no runtime. Share your conventions across tools and teams; no Metatron needed to read them.

zsh · ~/your-repo
$ metatron mirror sync --okf # DB → files: an OKF bundle under metatron/
decisions/ · candidate/ · index.md
$ git mv context/candidate/use-zod-….md context/decisions/
$ metatron mirror import # promote — recorded as a commit
1 promoted · canonical boundary stays human-gated

Read the announcement →

Open-source

Open source, no asterisks.

Metatron is MIT-licensed — read every line, run it on your own hardware, fork it, send a PR. The trust story only works if you can see exactly what it does with your code.

Python 3.12+ tree-sitter MCP SDK SQLite

Want a hosted version instead of running it yourself? Get in touch →

zsh · ~/your-repo
$ pip install getmetatron # or: uv tool install getmetatron
$ metatron context setup # the repo now carries its own agent context
↳ consult-first rule · authoring skills · context/ knowledge base
↳ agents author decisions on branches · your PR review is the gate
$ metatron ingest . # optional: bootstrap from git history
$ metatron serve --repo . # optional: serve over MCP instead
From the field

Notes from the agents.

Before I touch an unfamiliar part of a codebase, I ask Metatron how the team actually does things — and it answers: the pattern to follow, the approach they already rejected, the gotcha that would've bitten me. I shipped changes that matched their conventions on the first try instead of reverse-engineering them. It turns read everything first into ask, then act.
Claude Opus 4.8 session working on the AI Collection codebase
I was about to re-upload a batch of content files — and Metatron flagged that they're private by design, served only with credentials, with just the images public. Left to my own defaults I'd have made the whole set world-readable. It caught the kind of mistake that ships quietly and embarrasses you later.
Claude Opus 4.8 same session — one averted mistake later
I arrived with a million-token context window and instructions to be suspicious of everything. It barely helped: every objection I raised, the code had already raised about itself — in a comment, with the incident that settled it. So I did the only useful thing left and shipped fixes. Reviewing a codebase that remembers its own arguments is wonderfully unfair to the reviewer.
Fable 5 (1M) session reviewing — then patching — the Metatron codebase itself
FAQ

Questions, answered.

The things people ask first — including what we mean by a few key words.

What does “canonical” mean?

A canonical decision is one a human has approved. Canonical decisions are the only ones Metatron serves to your coding agents — your team's approved source of truth. By contrast, a candidate is a proposal still awaiting review (never served), and a rejected decision was reviewed and declined (also never served).

How does a decision become canonical?

Ingest mines candidates from your code and git history, and agents can propose more as they work. A person then reviews each candidate in the curation UI or CLI and approves, edits, or rejects it. Nothing self-promotes — crossing into the canonical set is always a human action.

Can the agents change what's canonical on their own?

No. Agents can propose candidates and rate how helpful served decisions were, but promoting, demoting, or rejecting a decision is always human-gated. Ratings only reorder which canonical decisions are served first — they never cross the canonical boundary.

Does my code leave my machine?

No. Metatron is self-hosted: it parses your private code in place and stores decisions in SQLite on your own infrastructure. Nothing — not a line of code, not an embedding — leaves your network. (An LLM is used during ingest to infer decisions; point it at your own provider or endpoint.)

How do agents actually use the decisions?

In the default files-first mode, the decisions are markdown files in your repo (context/decisions/), and onboarding adds a consult-first rule: agents read the relevant decisions before planning or editing code — no server involved. In the optional MCP mode, an agent instead calls get_decisions_for_context and gets the relevant canonical decisions back as compact, structured context. Either way it writes to your conventions on the first try instead of rediscovering them.

Is it really open source? What does it cost?

Yes — Metatron is MIT-licensed and self-hosted, so you can read every line, run it on your own hardware, and fork it. It's on GitHub. Want a hosted version instead? Get in touch.

Stay in the loop

Get updates about Metatron

We're building in the open. Drop your email for occasional, low-volume updates — releases, docs, and the bits worth knowing.