agexsDocs

Cursor memory: rules, AGENTS.md, hooks and MCP

Does Cursor remember between chats? What happened to Cursor Memories, how rules, AGENTS.md and @Chats carry context, and how to add memory over MCP and hooks.

Cursor does not remember between chats on its own. Its Memories feature is no longer in the docs: the old Memories page now redirects to Rules. What persists today is what you write down: Project Rules in .cursor/rules, AGENTS.md, and User Rules. Past chats can be searched and pulled in with @Chats. For memory that grows while you work, add an MCP memory server in ~/.cursor/mcp.json and hooks in ~/.cursor/hooks.json.

What happened to Cursor Memories

Memories arrived in Cursor 1.0 (June 2025) as a beta. The changelog said Cursor "can remember facts from conversations and reference them in the future", that memories were "stored per project on an individual level", and that you turned them on under Settings, Rules. Cursor 1.2 made Memories generally available and added user approval for memories generated in the background.

That is no longer the current state. The docs URL for Memories (cursor.com/docs/context/memories) now redirects to the Rules page, and the current docs index has no Memories page. The Rules page opens with this line instead: "Large language models don't retain memory between completions. Rules provide persistent, reusable context at the prompt level."

So plan as if Cursor has no automatic memory. If you still have old memories you rely on, copy what matters into a rule.

Project Rules in .cursor/rules

Project Rules are .mdc files in .cursor/rules, kept in git. When a rule applies, its content goes to the start of the model context. Each rule has frontmatter:

---
description: How we write database migrations
alwaysApply: false
---

- Every migration has an up and a down step.
- Never change a column type in place.
  • alwaysApply: true adds the rule to every chat.
  • globs attaches it when a matching file is in context.
  • A description alone lets the agent decide.
  • With none of them, the rule loads only when you @-mention it.

A plain .md file in .cursor/rules is ignored. Type /create-rule in chat, or ask the agent to write a rule, when you want to keep a lesson from the current chat. Cursor suggests keeping each rule under 500 lines.

AGENTS.md

Cursor reads AGENTS.md, plain Markdown with no frontmatter, in the project root and in subdirectories. Nested files combine with their parents, and the more specific one wins. Codex and Claude Code read AGENTS.md as well, so it is the place for project facts that every agent should see. See CLAUDE.md vs AGENTS.md.

User Rules

User Rules live in Customize, Rules. They apply to all your projects and are used by Agent (Chat). They are the closest thing to a personal memory: your reply style, your stack, the tools you prefer.

Reply in short sentences. Use pnpm, not npm.

They stay in your Cursor account. Teammates do not see them.

Chat history and context

Each chat starts fresh, apart from the rules that apply. Old chats are still useful:

  • Conversation search: in the Agents Window, press Cmd+K (Ctrl+K) to search past transcripts. Cursor keeps a local index.
  • @Chats attaches context from a previous conversation to the current one.
  • Side chats keep their own transcript and use the parent thread as hidden context. @-mention a side chat to pull it back into the main thread.

You have to know which chat to attach. The agent does not look through old chats by itself.

MCP memory servers in mcp.json

Cursor connects to MCP servers over stdio, SSE or Streamable HTTP. A memory server is one kind. Put it in ~/.cursor/mcp.json for every project, or in .cursor/mcp.json for one project:

{
  "mcpServers": {
    "memory": {
      "url": "https://memory.example.com/mcp"
    }
  }
}

A local server uses command and args instead of url. Remote servers can sign in with OAuth. Values support interpolation such as ${env:NAME}, so tokens can stay out of the file.

Over MCP alone, the agent has to decide to call the memory tool. It rarely searches for what it does not know it is missing. See MCP memory servers compared.

Hooks

Cursor has hooks: scripts that run at stages of the agent loop, defined in ~/.cursor/hooks.json for all projects or .cursor/hooks.json in a repo. They arrived in Cursor 1.7, and project level hooks came in 2.1.

Hooks that matter for memory:

  • sessionStart runs when a new conversation is created. It can return additional_context, which is added to the conversation's initial context.
  • beforeSubmitPrompt runs after you hit send and can block the prompt.
  • preCompact, stop and afterAgentResponse fire later in the loop.
{
  "version": 1,
  "hooks": {
    "sessionStart": [{ "command": "./hooks/load-notes.sh" }]
  }
}

User hooks in ~/.cursor/hooks.json do not run in cloud agents, which only see project hooks from the repo.

What carries over between chats

SourceWhere it livesWritten byShared with team
Project Rules.cursor/rules/*.mdc in gitYou or the agent on requestYes, through git
AGENTS.mdRepo root and subfoldersYouYes, through git
User RulesCustomize, RulesYouNo
Team RulesCursor dashboardAdmins (Team, Enterprise)Yes, all repos
Past chatsLocal transcriptsCursorNo, only via @Chats by hand
MCP memory serverThe serverThe agent, when it calls the toolDepends on the server

Checked November 2026.

For sharing rules across a team and many repos (Team Rules, marketplaces, submodules), see Share Cursor rules across a team and many repos.

Where Cursor's own memory stops

  • Lessons from chat. A correction stays in that chat unless you or the agent write it into a rule.
  • Old chats. They are searchable, but nothing from them loads unless you attach it.
  • Teammates. User Rules and chats are yours. A teammate's Cursor never sees them.
  • Other agents. Claude Code and Codex read AGENTS.md, but not .cursor/rules, User Rules or Team Rules.
  • Knowledge beyond one repo. Servers, accounts and deploy steps have no natural home in a repo rule.
  • Rules that must hold. A rule is guidance in the prompt, not a check.

If you work alone in one repo, rules in git plus a few User Rules are often enough. Stop there.

A shared memory server: agexs brain

agexs brain adds an MCP server and hooks to Cursor. For Cursor it adds:

  • Memories that come to the agent: your always-on rules at session start, the memories of a project, server or tool on the first work there, and the memories that match each prompt.
  • Lessons saved while you work. When you correct the agent, agexs brain asks it to save the lesson as a short memory. It checks for near-duplicates first and refuses memories with secrets. You can also say "remember that" or "forget that".
  • One store for Claude Code, Codex and Cursor, with private and team spaces. See Memories and spaces.
  • Rules that block a command, ask first or remind.

If agexs brain is down, Cursor keeps working without memories: every hook gives up after a few seconds.

Setup

Install the agexs CLI, then:

agexs login
agexs install cursor

This adds the hooks to ~/.cursor/hooks.json and the MCP server to ~/.cursor/mcp.json. The token goes into ~/.config/axs-brain/cursor.json. Every file it changes gets a backup first. Then open Customize in the Cursor sidebar, find agexs brain under MCP servers and sign in. See Connect your agents. agexs uninstall cursor takes the entries out again.

Your existing .cursor/rules, .cursorrules and AGENTS.md can be imported, one memory per rule or fact. Your files stay as they are. See Plans and billing.

FAQ

Does Cursor remember previous chats?

Not by default. Each new chat gets your rules and AGENTS.md, but not earlier conversations. Attach one with @Chats, or search transcripts with Cmd+K in the Agents Window.

Were Cursor Memories removed?

The current docs no longer describe them. The old Memories page redirects to Rules, which says models do not retain memory between completions. Use rules for anything that must persist.

Where does Cursor store rules?

Project Rules are .mdc files in .cursor/rules in your repo. User Rules are in Customize, Rules. Team Rules are in the Cursor dashboard.

How do I give Cursor long term memory?

Write lasting facts into Project Rules or AGENTS.md. For memory that grows while you work and spans repos, add an MCP memory server in ~/.cursor/mcp.json, plus hooks so memories load without the agent asking.

Does Cursor read AGENTS.md?

Yes, in the project root and in subdirectories. Nested files combine with their parents, and the more specific one wins.

Last updated on

On this page