explaingit

brain0-ai/brain0

Analysis updated 2026-05-18

22RustAudience · ops devopsComplexity · 3/5LicenseSetup · moderate

TLDR

A passive observer that links every git commit to the AI agent prompt behind it, catches when agents misrepresent what they changed, and logs which sensitive files agents read before pushing code.

Mindmap

mindmap
  root((brain0))
    What it does
      Link commits to agent prompts
      Drift detection
      Sensitive file read audit
      Risk scoring
    Agent Memory MCP
      Query history before editing
      File risk and blame
      Root cause debug
    Tech Stack
      Rust core
      TypeScript GUI
      SQLite storage
      Ollama local models
    Use Cases
      AI code accountability
      Security audit of agent sessions
      Debugging AI-introduced regressions
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

What do people build with it?

USE CASE 1

Trace which AI agent prompt introduced a bug by clicking a suspicious commit in the graph and reading the exact prompt and diff side by side.

USE CASE 2

Audit whether any recent Claude Code or Codex session read a .env file or private key before pushing code to the repository.

USE CASE 3

Give your AI coding agent a memory of the codebase by connecting brain0 as an MCP server so it can check a file's risk history before editing it.

What is it built with?

RustTypeScriptSQLiteOllamaMCP

How does it compare?

brain0-ai/brain0proxyshard/shardbrowsertuanle96/zca-desktop
Stars222222
LanguageRustRustRust
Setup difficultymoderatemoderatehard
Complexity3/53/54/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Node.js 20+, local Ollama models improve summaries but are optional, works offline without them.

Apache 2.0: use freely for any purpose, including commercial use, as long as you keep the copyright and license notices.

In plain English

Brain0 is a tool that answers a question growing more important as AI coding agents write more and more code: not just what changed in a commit, but why it changed, which AI prompt wrote it, and whether you can trust it. Git tells you what files were modified, brain0 builds a layer on top that links each commit to the specific agent session and prompt behind it. The tool works entirely by observation. It reads your git history and the session transcripts that coding agents like Claude Code and OpenAI Codex already write to disk automatically. It requires no changes to your codebase, no hooks, and no cooperation from the agents themselves. Running a single command starts the indexing process and opens a visual graph in your browser where you can explore commits, files, and functions alongside the prompts that produced them. Three specific insights that git alone cannot provide: First, drift detection compares what an AI agent said it changed in its explanation with what it actually changed in the diff. If an agent described a small update but touched twenty files, brain0 flags the gap. Second, a data-focused audit layer records which files each agent session read before writing code, flagging cases where sessions accessed environment files or files containing secrets before pushing changes. Third, a risk score tracks each change based on how many things it affects and updates later if the change was reverted or immediately patched. Brain0 also works as a memory layer for your AI agent via an MCP server connection. Your coding agent can query the graph before touching any code to understand the risk and history of what it is about to modify, including which prior prompt last changed a function and whether similar changes were later reverted. The core is written in Rust and the GUI in TypeScript. It runs offline by default using SQLite for storage and local models via Ollama for summaries, with no data sent to external services unless you configure a hosted API key. It requires Node.js 20 or later and is released under the Apache 2.0 license.

Copy-paste prompts

Prompt 1
I use Claude Code on a project with several active AI coding agents. Walk me through running brain0 for the first time: what command do I run, what does it index, and what appears in the browser graph?
Prompt 2
How does brain0's drift detection work? What does it compare, how is the gap scored, and where do I see the drift report in the output?
Prompt 3
I want to audit which files my AI agents have been reading before committing code. How does brain0's DLP-style sensitive-read tracking work and what does it log?
Prompt 4
Show me how to add brain0 as an MCP server for Claude Code so my agent can query commit history and risk scores before touching a file.

Frequently asked questions

What is brain0?

A passive observer that links every git commit to the AI agent prompt behind it, catches when agents misrepresent what they changed, and logs which sensitive files agents read before pushing code.

What language is brain0 written in?

Mainly Rust. The stack also includes Rust, TypeScript, SQLite.

What license does brain0 use?

Apache 2.0: use freely for any purpose, including commercial use, as long as you keep the copyright and license notices.

How hard is brain0 to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is brain0 for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub brain0-ai on gitmyhub

Verify against the repo before relying on details.