cerebro

A local, cached map of a codebase that stores summaries, symbols, and dependency relationships in a SQLite database.

In plain words
What is it for?
Use it to search for relevant code, inspect cached file summaries, find symbols and dependencies, and record new understanding for later sessions.
Why use it?
It helps an agent understand a project without repeatedly reading every folder and file from scratch.

Skill for Claude CodeCodex

Part of the cerebro plugin — 1 skill, 5 agents, 4 hooks, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/marcodavidd020/cerebro-code-memory/cerebro
Any agent
npx skills add marcodavidd020/cerebro-code-memory --skill cerebro
Clone the repo
git clone --depth 1 https://github.com/marcodavidd020/cerebro-code-memory

Made for: Claude Code, Codex.

Or install cerebro, the plugin that ships this one along with the rest of its 1 skill, 5 agents, 4 hooks, 1 MCP server.

Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 902 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00072 $0.00902
Opus 5 $0.00036 $0.00451
Sonnet 5 $0.00014 $0.00180
Haiku 4.5 $0.00007 $0.00090

Measured 3d ago against content hash 945c33efdc4a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cerebro scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/skills/cerebro/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cerebro — reuse cached code understanding

Cerebro is an MCP server that persists what previous sessions learned about this codebase in a local SQLite brain. Querying it costs a fraction of the tokens that re-reading folders does. Prefer Cerebro over cold exploration.

When you start work on a project

  1. Call cerebro_map() for the overview: file counts and the most important modules ranked by dependency centrality. This replaces listing directories.
  2. Call cerebro_search("<what you're looking for>") to find relevant code by meaning (semantic) + keyword — a hit resolves to the exact symbol (path:line), not just the file. Phrase it as a natural question.
  3. Call cerebro_get("path/to/file") to get a file's cached summary, its symbols, and its dependency edges without reading the file.

Only fall back to actually reading a file when:

  • cerebro_get reports no summary yet, or
  • the summary is flagged ⚠ STALE (the file changed since it was summarized).

As you learn (leave traces for the next session)

After you genuinely understand a file (because you read it or worked on it), call:

cerebro_record(path="path/to/file", summary="<1-3 dense sentences IN ENGLISH>")

Write the summary in English (cheaper tokens) describing what the file does and its role in the system. This is the whole point: the next chat reuses your work instead of re-deriving it.

Decisions and the why

Code reading recovers WHAT exists, never WHY. When you learn a decision, a domain rule, or a gotcha that isn't obvious from the code, record it:

cerebro_note(content="QR_MANUAL = merchant confirms payment by hand, no gateway", topic="payments")

Before re-deriving the reasoning behind some area, call cerebro_recall("payments") (or with no query for recent decisions) — a past session may have already figured it out. The session-start hook surfaces recent decisions automatically.

Keeping fresh

  • cerebro_stale() lists files changed/added/deleted since the last index and summaries that no longer match their file.
  • cerebro_reindex() refreshes the structural index (only changed files are reprocessed). The plugin runs this automatically after edits.

Read the full file on GitHub · 81 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 81 lines · 72 tokens per session scan A 945c33efdc4a

Subscribe to this mod's changes

cerebro is a skill published in the GitHub repository marcodavidd020/cerebro-code-memory (6 stars, last pushed 2mo ago), licensed MIT. It adds 72 tokens to every session and 902 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

graph-retrieval

Exposes graph-based retrieval as a tool capability via querygraph. Reads normalized graph store files, builds a query-relevant subgraph, and returns LLM-friendly semantic triples with replayable evidence metadata.

study8677/repobrain · 46 tokens

graph

Whole-codebase structural map of the codanna index as one self-contained HTML disc. Wedges per top-level module, concentric rings with hubs at the centre, hover or click a symbol to light its edge web, search, hide or highlight modules, brush a date range on the ribbon timeline (symbols dated by git blame), heatmap of…

bartolli/codanna · 131 tokens

x-ray

Deep codebase exploration using semantic search and relationship mapping. Use when you need to understand the current codebase.

bartolli/codanna · 25 tokens

knowledge-layer

High-level deployment wrapper over RepoBrain core with graph-first knowledge injection and all-file support. Exposes refreshfilesystem and askfilesystem for building and querying the knowledge graph.

study8677/repobrain · 42 tokens

agent-repo-init

Bootstraps a new multi-agent repository from the RepoBrain template via initagentrepo. Supports quick scaffold and full runtime profile setup including MCP toggle, swarm preference, sandbox type, and optional git init. LLM configuration is handled later by rb-setup.

study8677/repobrain · 58 tokens

research

Performs deep research on a topic via deepresearch. Simulates a multi-step research process and returns a comprehensive research result as a string.

study8677/repobrain · 32 tokens