brain0 CLI
A CLI that builds a repository decision graph: which agent prompt produced a commit and how far to trust the change
- 314 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- Reads agent transcripts in ~/.claude/projects and ~/.codex, which hold prompts and code fragments
- Records paths of files the agent read, secret files included
- Starts a local web interface on port 8787 and uses an external model for chat when keys are set
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/brain0Detects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Reads agent transcripts in ~/.claude/projects and ~/.codex, which hold prompts and code fragments
- Records paths of files the agent read, secret files included
- Starts a local web interface on port 8787 and uses an external model for chat when keys are set
This is third-party code. Review the repository files before installing.
What it does
brain0 links every commit to the coding-agent prompts that led to it, down to a single function. It only observes: it reads git history and the Claude Code and Codex transcripts that agents already write to disk. It leaves the code alone and needs no hooks. The first run, `npx brain0 up`, indexes the history, ingests agent sessions and opens a codebase graph from repository down to symbol in the browser at http://localhost:8787. The graph shows three things. The first is drift between what the agent declared and what it changed in git. The second is secret reads: which files a session opened, including .env and private keys. Only paths and secret kinds are recorded, never values. The third is a change danger score from green to red that accounts for diff size, churn and later reverts. `brain0 today` gives a morning triage, `brain0 report` prepares a team report, and `brain0 query` searches the graph for a root cause. The agent itself gets an MCP server with context, blame, debug and audit tools.
Who it is for. Team leads and developers whose agents write most of the diff and who need to know where a change came from and whether the agent read more than it should.
Good fit when
- A bug appeared after a series of agent commits and you need the prompt that introduced it
- The agent reported a small change and you want to check the claim against the real diff
- Before pushing you need to check whether a session opened .env or a private key
- Each morning you want a quick view of what agents did and which changes are riskiest
- The agent needs history before editing a function again: who changed it and why
Not a fit when
- A repository has no git and no agent transcripts: the graph will be empty, use checkpoint mode through `brain0 watch`
- You work on Alpine or another musl Linux: it is not supported yet
- You need a guarantee that nothing secret reached a model: the read list gives only a lower bound
Example request
Run npx brain0 up in this repository and show which agent commits of the past week score as the most dangerousLimitations
Requires Node.js 20 or newer, and on Linux glibc 2.28 or later (Debian 10, Ubuntu 20.04, RHEL 8). Without Ollama it falls back to deterministic summaries, local embeddings and retrieval-only answers. With Ollama it uses qwen3:4b for summaries and qwen3-embedding:0.6b for embeddings. With a 4 GB GPU you can pick qwen3:1.7b for the first run. The agent read list is built from the transcript and shows the minimum of what reached a remote model. The Apache-2.0 license covers the Rust core and the TypeScript interface.
How to disable. Stop the brain0 process and delete the .brain0 folder in the repository, which holds the local index. If you connected MCP, remove the server with claude mcp remove brain0. The summary cache lives in ~/.cache/brain0.
FAQ
How do I find which agent prompt introduced a bug?
Run npx brain0 up, open the graph and pick the problem commit or function: prompts, model and drift against the declared change sit beside it. For root cause search there is the brain0 query command with a question in plain text.
Does it need hooks or code changes?
No. brain0 reads git and the transcripts that Claude Code and Codex already write to ~/.claude/projects and ~/.codex. It changes neither the code nor the git history.
What is recorded about secrets that were read?
File paths and the secret kind, for example env_secret. At ingest brain0 scans the content of tool results.
How do I give brain0 to the agent through MCP?
Run claude mcp add brain0 -- brain0 mcp. Before editing a file, the agent can then ask for its history and danger score.
How is brain0 different from Obelisk?
Obelisk gathers agent session history into one SQLite file for search. brain0 also ties sessions to commits and functions, reconciles the declared with the real diff and scores how dangerous changes are.
Discussion
No questions or reviews yet.
Related
CLI toolsCode graph and project memory in one Rust program: the agent gets excerpts with file and line citations
Gives the agent an understanding of your repository: it indexes the code and answers questions about it in Claude Code, Cursor, Codex, Windsurf and more
A Python terminal coding agent in the manner of Claude Code: reads the repository, edits files, runs commands, with memory, sub-agents and MCP
Indexes a codebase into a knowledge graph and gives the agent call chains, change blast radius and code search over MCP
Context Engine: code search and memory for an agent
Context Engine
A skill that teaches an agent to query the Context Engine code index and symbol graph before reading files directly
Work modes for AI coding agents: a light solo mode for daily tasks and /man with a plan, checks and review for big changes
README in short
The author calls brain0 the black box for AI-written code: git shows what changed, and brain0 explains why. Storage defaults to SQLite with sqlite-vec, and the enterprise variant runs on Postgres with pgvector.