Methods  ›  Memory Bank
Method reference · community pattern

Memory Bank (Cline / Roo / Cursor)

The agent reads a small folder of Markdown files at the start of every task. This folder is its long-term memory. You update these files by hand.

Community pattern Always-loaded · read every task Supersession: manual reconciliation Our benchmark: 6/6 (perfect maintenance) …drops to ~5/6 under lag

What it is

Cline and Roo Code made this method popular. It uses a folder of small, separate files instead of one giant file. The agent’s memory resets after each session. So, a rule makes it read every file in the folder before each new task. Some files describe the project and rarely change. Others, like activeContext.md, track your current work. Roo also adds a decisionLog.md file, where new decisions are added to the end.

Setup

  1. Add a rule, like a .clinerules file or custom instruction. The rule tells the agent: “Read all memory-bank/ files at the start of every task; they are the source of truth.” This step is required.
  2. Ask the agent to “initialize memory bank.” It will create the basic files from your code and documents.
  3. Work as you normally would. When you make a big change, tell the agent to “update memory bank” or “UMB.” The agent will review all the files, rewrite activeContext.md, and add new entries to decisionLog.md.
  4. Periodically, you must reconcile the files. This means merging the log file back into the main project files. This keeps them from becoming outdated. You also need to re-sync the folder when you change computers or work with teammates.

Sample directory structure

your-project/
├─ .clinerules              # "read memory-bank/ every task; it is the source of truth"
└─ memory-bank/
   ├─ projectbrief.md       # what the project is        (stable — drifts)
   ├─ productContext.md     # who it's for / why         (stable — drifts)
   ├─ systemPatterns.md     # architecture, conventions  (stable — drifts)
   ├─ activeContext.md      # current focus              (update often)
   ├─ progress.md           # done / remaining           (update often)
   └─ decisionLog.md        # append-only decisions      (Roo; newest at bottom)

Here’s the trick: the rule file contains no facts about the project. It only points to the folder. This prevents a common problem where the agent reads a summary and misses the real details. The log file always has the latest information, so the other files can be slightly out of date.

Pros & cons

Strengths

  • Factless pointer. The main rule file has no facts, so it can't become outdated. It won't stop the agent from reading the source files, avoiding a common failure.
  • Structured slots. Separate files create clear places for information. This helps the agent make updates correctly every time.
  • Append-only log. The log file creates a history of decisions in order. This makes it clear which information is the newest.
  • Firm consult directive. The instruction “Read everything, every task” is simple and clear. The agent follows it reliably.

Weaknesses

  • Manual updates. You have to remember to tell the agent to update the files. If you forget, its knowledge becomes outdated.
  • Session-bound capture. It only knows what happens in the session. Decisions from Slack or meetings must be added by hand.
  • Token tax. The agent reads the growing files for every task. Developers report using ~300k tokens after about ~5 updates.
  • Silent update failures. A known bug means the agent may say it updated files but not actually save the changes.
  • Workspace-bound. The memory lives in one project folder. It doesn't sync between computers, teammates, or tools like Cline and Cursor.
  • Reconciliation debt. The main files become outdated compared to the log. Someone has to merge the changes manually.

Common user feedback

This feedback comes from GitHub, Cline's own documents, and other articles. (Note: One source, MemoryLake, sells a competing product, but other neutral sources confirm the issues it raises.)

How it did in our benchmark

We tested the agent on six facts that had been updated. The new facts were in decisionLog.md. The old facts were in the other files. The score shows how many of the six facts the agent got right.

conditionOpus 4.8Haiku 4.5Gemini 2.5 Flash
perfect maintenance6/66/60/6 (reads it, ships stale)
under maintenance lag~5/6~5/6~2/6
Memory Bank scores a perfect 6/6, tied for the best. But this only works if you update it perfectly and use a good model. Two parts of its workflow can break it. First, it becomes outdated if you forget to log a change. Second, a weaker model might read all the files but still use the old information if it fails to check the log. It is the best you can do *manually* to keep context up to date. Other automatic methods handle this better. See the full results →
Part of the methods reference for the stale-context benchmark. External links point to the original sources. All quotes are cited where they appear.