# Cursor Memory Bank: A Practical Setup That Stays Current

> How to keep Cursor agents consistent across chats using CURSOR.md, scoped rules, and auto-sync, plus when a full memory-bank folder is worth it.

Canonical: https://www.agentickit.co/blog/cursor-memory-bank-setup
Last updated: 2026-08-14

Your agent is not forgetful. You never gave it a file it is required to re-read. Every new Cursor chat starts empty. Rules, plans, and whatever you paste are the only memory it has.

"Memory bank" is the name the community gave to that problem. The usual answer is a folder of markdown novels (`projectbrief.md`, `activeContext.md`, `progress.md`, `techContext.md`) and a rule that says "read these first." Sometimes that helps. Often the files go stale, and the agent now has two contradictory brains: yesterday's `techContext.md` still says Prisma, today's `package.json` says Drizzle.

This is the setup I actually run: one living `CURSOR.md`, glob-scoped rules, and a hook that refreshes stack facts from the repo. A full memory-bank folder is optional, and I will tell you when it is worth it.

## The takeaway

Auto-sync the stack. Hand-write product law. Empty italic placeholders are how agents invent your ORM.

You need persistence for four kinds of truth:

1. **Constraints** the agent must not violate (rules)
2. **Live project state** (stack, scripts, tenant field, current priorities)
3. **Procedures** (skills and slash commands)
4. **What we decided last week** (a short current-work note, only if work pauses)

Most memory-bank templates mix all four into six files and then never update them.

## Three kinds of "memory"

**Official Cursor primitives.** [Rules](https://cursor.com/docs/rules) are prompt-level context. [Plan Mode](https://cursor.com/blog/agent-best-practices) can save plans to `.cursor/plans/`. `@Chats` lets a new thread read an old one. Product "Memories" (user-level facts the app stores) are a separate, personal layer. Do not treat them as the source of truth for a repo. They are not in git, and they are not your teammate's.

**Community memory bank.** Projects like `cursor-bank` and the Cline-style ports create a `memory-bank/` directory and a rule that loads it. The idea is sound. The failure mode is staleness. I have never seen a six-file bank that stayed true through an ORM change without a human nagging the agent to rewrite it.

**External MCP memory.** Services that store embeddings across projects. Useful if you want recall across repos. Useless as a substitute for "we use pnpm and Drizzle in *this* repo," which should be a file the agent can `read` without a network call.

AgenticKit's bet is the middle path: a single `CURSOR.md` that a hook keeps honest.

## What actually needs to persist for SaaS

Write these down. If a line is missing, the agent will guess.

- Product one-liner and stage (idea / MVP / production)
- Framework, language, database, ORM, auth, payments, styling, tests, deploy, package manager
- Exact scripts: lint, test, build, E2E
- Skip flags for `/ship` (DB / UI / E2E / AI / mobile)
- Paths: where API routes, pages, schema, and tests live
- Error shape
- Session strategy, protected routes, tenant field name
- Env vars for Stripe, the database, and auth (names only, never values)
- What not to do
- Current priorities (three bullets, not a roadmap)

That list is the `CURSOR.md` template in the kit. The filled example is `CURSOR.example.md` (a fake product called TaskFlow) so you can see what "done" looks like.

## The CURSOR.md setup

Put `CURSOR.md` at the repo root. Add one always-on rule that says: before any code change, read it.

Keep two kinds of sections visually obvious:

**Scan-owned.** Stack rows that can be inferred from `package.json`, lockfiles, `drizzle.config.ts`, `prisma/schema.prisma`, `firebase.json`, `go.mod`. A human should not have to update "we added Playwright" in two places.

**Human-owned.** Positioning, stage, tenant field, what not to do, current priorities. A scan must not overwrite these. If your sync is allowed to clobber the one-liner, you do not have memory. You have a generator.

AgenticKit's merge does exactly that split. `npx agentickit-cursor sync` (or `watch`, or `scan`) refreshes inferred stack into `CURSOR.md` and leaves filled product fields alone. The hook file is small on purpose:

```json
{
  "version": 1,
  "hooks": {
    "sessionStart": [
      { "command": "node .cursor/hooks/sync-cursor-md.js" }
    ],
    "afterFileEdit": [
      {
        "command": "node .cursor/hooks/sync-cursor-md.js",
        "matcher": "Write|TabWrite"
      }
    ]
  }
}
```

Session start means a new chat sees today's `package.json`, not last month's. After-file-edit means adding Drizzle mid-session can update the file before the next turn. You can run the same merge by hand if you do not want hooks.

## Optional memory-bank files

Add extra files when `CURSOR.md` is the wrong shape:

- **`docs/active-context.md`** (or `.cursor/memory/active.md`): what you were in the middle of, if you pause for more than a day or hand the repo to someone else. Five bullets. Delete them when the slice ships.
- **`.cursor/plans/`**: the spec for the current feature. This is official Cursor, not a community invention.
- **A decision log** only if you keep making the same product decision twice (auth provider, tenant model). One line per decision. Not a blog.

Skip `progress.md` that tries to be git. Git is the progress file.

Skip pasting the entire architecture into `techContext.md`. Point at `src/lib/auth.ts` and `src/db/schema.ts`. Pointers age better than copies. That is also [Cursor's rule advice](https://cursor.com/docs/rules).

## Session start ritual

The ritual is one line in the always-on rule, not a speech you type:

1. Read `CURSOR.md`
2. Read the active plan if one exists
3. Copy the nearest existing file

If you find yourself pasting the stack into the first message of every chat, the ritual is not installed.

## Failure modes

**Stale memory.** The bank says Clerk. The repo says Auth.js. The agent imports both. Fix: scan-owned sections, or delete the bank.

**Conflicting files.** `AGENTS.md`, `CURSOR.md`, User rules, and `memory-bank/projectbrief.md` all describe the stack. Pick one live file. The others should point at it.

**A 2,000-line dump.** The agent will drop the middle. Same failure as a fat always-on rule. See the [rules article](/blog/cursor-rules-saas-founders).

**Memories you cannot see.** If the only copy of "we do not use Stripe yet" lives in a personal Cursor Memory, the next person (or the next machine) will add Stripe.

## When not to bother

A throwaway spike. A repo you will delete on Friday. A tutorial clone. Write the stack in `AGENTS.md` and move on.

If you are mid-project and tired of re-explaining the tenant field, fill `CURSOR.md` today. Grade nothing, buy nothing, just replace the italic placeholders. The [shipping workflow](/blog/cursor-workflow-shipping-saas) assumes that file exists. The [project-conventions skill](/skills/project-conventions) is the standard [tech-lead](/agents/tech-lead) is told to keep intact. To control what the agent may do once it has that context, see the [RIPER-5 workflow](/blog/riper-5-cursor-workflow). The [Config Converter](/tools/config-converter) will turn an old `.cursorrules` into `.mdc` if that is where your stack currently lives.


## Related
- [config-converter](https://www.agentickit.co/tools/config-converter)
- [package-auditor](https://www.agentickit.co/tools/package-auditor)
- [tech-lead](https://www.agentickit.co/agents/tech-lead)
- [project-conventions](https://www.agentickit.co/skills/project-conventions)
- [/ship](https://www.agentickit.co/commands/ship)
