← Home

Guide

Codebase Memory

A bot with file access can read your code. It cannot hold it. Codebase Memory builds a structured index — symbols, relationships, context — so the project survives between sessions instead of being rediscovered each time. Works on OpenClaw and Hermes.

The Problem With Reading Files

Every conversation starts cold. The agent opens a file, follows an import, opens another, and by the time it understands the shape of things it has spent most of the context window getting there. Ask a related question tomorrow and it does the whole tour again.

An index changes the economics: the structure is already computed, so the agent looks things up instead of reading its way to them.

Install It

  1. Open the dashboard and go to Tools.
  2. Pick a running bot — tools install per instance.
  3. Install Codebase Memory. It runs locally in your container as an MCP server, with no web UI and nothing to keep alive.

On Hermes, restart the bot afterwards if it does not seem to notice the tool.

Indexing happens on demand rather than continuously. The first pass over a large repository briefly uses more memory than steady state — worth knowing if the instance is already tight on RAM, and a reason to index the repository you care about rather than everything on disk.

What to Ask For

  • “Index this repository, then tell me how authentication flows through it.”
  • “Which modules depend on this one?”
  • “Where would a new payment provider need to be wired in?”
  • “Summarise what changed conceptually, not line by line.”
  • “I am back — remind me how the worker and the API talk to each other.”

That last one is the point. The value shows up on the second and tenth conversation, not the first.

Three Kinds of Memory, Kept Separate

  • Codebase Memory — structural knowledge of a repository.
  • The framework’s own memory — what you told the bot and what it learned in conversation. See OpenClaw memory and Hermes memory.
  • Skills — procedures you want followed, which is knowledge of a different kind again.

They do not substitute for each other. A bot that remembers your architecture still needs telling how you like pull requests written.

Codebase Memory or Serena?

They are complementary and often installed together. Serena answers precise questions in the moment — where is this defined, what calls it — through a language server. Codebase Memory holds the wider shape of the project across sessions. Precision versus persistence.

Troubleshooting

  • The first index is slow or heavy. Expected on a large repository. Index once, then work against it.
  • Answers feel out of date. The index is built on demand, so after a large change ask the bot to re-index.
  • Instance memory pressure. Indexing a very large tree on a small instance is a real cost. Index the part of the repository you actually ask about.

Try It

Install it, ask the bot to index a project, then ask an architectural question you would normally have to answer yourself. Come back tomorrow and ask a follow-up — that second answer is what you installed it for.

Related: the Tools catalog, Serena, coding workspaces, OpenClaw memory.