explaingit

kerbelp/metatron

13PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

Metatron studies your codebase and extracts the decisions behind it, patterns, conventions, rejected approaches, then serves them to AI coding assistants via MCP so agents write code that actually fits your project.

Mindmap

mindmap
  root((Metatron))
  What it does
    Extracts code decisions
    Stores conventions
    Feeds AI agents
    Captures intent
  How it works
    Ingest repo signals
    Human review step
    Serve via MCP
    Refine from feedback
  Tech stack
    Python
    SQLite database
    Anthropic API
    MCP protocol
  Use cases
    AI-assisted coding
    Team onboarding
    Convention capture
    Multi-repo sharing
  Audience
    Developers
    Vibe coders
    Team leads
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Connect your AI coding assistant to your codebase's unwritten rules so it stops reinventing patterns you've already settled on.

USE CASE 2

Capture team conventions and rejected approaches in a portable file you can hand to a new colleague or open-source contributor.

USE CASE 3

Let an AI agent report gaps in its understanding of your code, then review and approve those insights before they become canonical.

USE CASE 4

Keep AI-generated code consistent across a long project by giving the agent a live memory of past decisions.

Tech stack

PythonSQLiteAnthropic APIMCPDockerpipuv

Getting it running

Difficulty · moderate Time to first run · 30min

Install via pip, uv, or Docker. An Anthropic API key is required for the ingest and feedback-refinement steps. The serve command runs fully locally with no API calls.

License not mentioned in the explanation.

In plain English

Metatron is a self-hosted tool that studies a codebase and extracts the decisions behind it: which patterns the team prefers, which approaches were tried and rejected, what the internal conventions are, and where the edge cases hide. It stores those decisions as structured records and then makes them available to AI coding assistants via MCP, which stands for Model Context Protocol. The idea is that an AI agent connected to Metatron can write code that fits the existing codebase instead of rediscovering its rules from scratch on every task. The workflow has three main steps. First, you run an ingest command that analyzes your repository. It reads structural signals like imports, decorators, base classes, and commit history, but does not send raw source code to any external model. It uses the Anthropic API to turn those signals into a set of candidate decisions. Second, you review the candidates yourself and approve the ones that are accurate. Nothing becomes part of the canonical knowledge base without human sign-off. Third, you run a serve command that makes the approved decisions available to your coding agent over MCP. There is also a feedback loop. As an agent works on your code, it can report gaps in what Metatron knows. A separate refine-feedback step processes those reports and generates new candidates, which again go through your review before they become canonical. This is meant to capture conventions that can only be seen through how the codebase is used rather than how it is written. Metatron stores everything in a SQLite database on your own machine. Each repository gets its own database file, so you can hand a colleague a single file and they can immediately connect their coding agent to the decisions you have already curated. The tool compares itself to code search tools like Copilot, which find code by text similarity, and code graph tools, which map how files and functions connect. Metatron's focus is different: it tries to capture the intent and reasoning behind code, not just the code itself. You can install it via pip, the uv package manager, or Docker. The Docker image includes a prebuilt multi-architecture version and can be pointed at directly in your agent's MCP configuration. The ingest and feedback-refinement steps require an Anthropic API key, the serve command runs fully locally with no API calls needed.

Copy-paste prompts

Prompt 1
I have Metatron set up with my repo. What MCP configuration do I need to add to Cursor so my AI assistant can query the decisions Metatron extracted?
Prompt 2
Walk me through the Metatron ingest command for a Python project. What signals does it read, and what do I need to review before anything is saved?
Prompt 3
I want to share my Metatron knowledge base with a teammate. How do I export the SQLite database file and where should they put it on their machine?
Prompt 4
My AI agent using Metatron reported a gap in the codebase conventions. How do I run the refine-feedback step and review the new candidates it generates?
Prompt 5
How do I run Metatron with Docker and point it at a repository that lives in a specific folder on my machine?
Open on GitHub → Explain another repo

← kerbelp on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.