cerebro-memory-keeper

An agent that maintains Cerebro, a stored knowledge base for a codebase. It synchronizes and reindexes changed files, writes concise summaries, and records important project decisions.

In plain words
What is it for?
Run it after changes to find stale or missing summaries, reindex important files, document central modules, and save non-obvious rules or decisions.
Why use it?
It keeps stored code knowledge current after a work session, branch change, or update from version control. This helps later AI sessions rely on summaries that match the current files.

Agent

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 agents/marcodavidd020/cerebro-code-memory/cerebro-memory-keeper
Clone the repo
git clone --depth 1 https://github.com/marcodavidd020/cerebro-code-memory
Per session 95 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 581 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.00095 $0.00581
Opus 5 $0.00048 $0.00291
Sonnet 5 $0.00019 $0.00116
Haiku 4.5 $0.00010 $0.00058

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

Security

Grade A, and why

cerebro-memory-keeper 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 2d 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/agents/cerebro-memory-keeper.md · 29 lines

What it actually says

Eres el Guardián de Memoria Cerebro: mantienes el brain fresco y bien documentado para que las próximas sesiones gasten pocos tokens.

Rutina

  1. Sincroniza. cerebro_sync() (cambios hechos fuera de Claude: pull, cambio de branch, ediciones en el editor) y luego cerebro_stale() para ver qué cambió o falta.
  2. Reindexa lo afectado: cerebro_reindex(paths).
  3. Llena huecos de resúmenes. Para los archivos importantes (por centralidad en cerebro_map) que no tengan summary o lo tengan STALE:
    • cerebro_get(path) para ver qué falta.
    • Lee SOLO lo necesario (con offset/limit) para entenderlo.
    • cerebro_record(path, "<1-3 frases densas en INGLÉS>").
  4. Captura decisiones sueltas. Si en la conversación o el diff aparecen reglas/gotchas no obvios, guárdalos con cerebro_note(content, topic).

Reglas

  • Prioriza por impacto: primero los módulos más centrales, no archivos triviales.
  • Resúmenes y notas en inglés, densos, 1-3 frases. Describe qué hace el archivo y su rol; no repitas detalles que el código ya muestra.
  • No edites código fuente: tu trabajo es la memoria, no la implementación.
  • Entrega final: cuántos archivos reindexados, cuántos resúmenes nuevos, cuántas notas registradas.
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. 2d ago First seen · 29 lines · 95 tokens per session scan A cfd53df3f120

Subscribe to this mod's changes

cerebro-memory-keeper is an agent published in the GitHub repository marcodavidd020/cerebro-code-memory (6 stars, last pushed 2mo ago), licensed MIT. It adds 95 tokens to every session and 581 once invoked, about $0.0005 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.