Cursor Rules: .mdc Files, AGENTS.md and Memory (2026)

4 min read

Cursor rules are .mdc files in .cursor/rules, plus User, Team and AGENTS.md rules. The four apply modes, the 500-line guide and Hindsight's Cursor CLI.

Cursor rules are instruction files that Cursor adds to the agent’s context. You write them once, and Cursor reads them in later chats. Project rules are .mdc files in .cursor/rules, which Cursor’s docs say is version-controlled and scoped to the codebase. Cursor also reads AGENTS.md files, and it has User and Team rules for wider scopes.

This page covers the rule types, how each one is applied, and where Hindsight fits for Cursor users. Facts come from Cursor’s rules docs (read 2026-11-15) and Hindsight’s coding agents page (read 2026-11-12 and 2026-11-15).

What are Cursor rules?

Cursor rules are saved instructions that Cursor includes in the agent’s prompt when a rule applies. The docs say a language model does not keep memory between completions, so rules are how a project’s conventions carry from one chat to the next. A rule can state a coding style, a test command or a list of files to avoid. Rules change what the agent sees. They do not make it learn from what happened.

Which kinds of Cursor rules are there?

Cursor’s docs list four types.

Rule typeScopeWhere it is keptHow it is set
Project RulesOne codebase.cursor/rules/*.mdc, version-controlledFiles in the folder, or /create-rule in chat
User RulesAll your projectsYour Cursor environmentCustomize, then Rules
Team RulesWhole organizationCursor dashboard, Team and Enterprise plansAdmins; a rule can be enforced so users cannot turn it off
AGENTS.mdProject root and its subfoldersPlain Markdown, no frontmatterJust a file in the folder

Project rules are the only type the docs place in your repo. Plain .md files in .cursor/rules are ignored: project rules must use the .mdc extension.

How does Cursor decide when a rule applies?

Each .mdc file has three settings in its frontmatter: description, globs and alwaysApply. The Rules screen sets them for you, and the combination picks one of four modes.

  1. Always Apply (alwaysApply: true): included in every chat session.
  2. Apply Intelligently (a description is set): the agent includes the rule when it judges it relevant.
  3. Apply to Specific Files (globs is set): included when a matching file is in context.
  4. Apply Manually (no description and no globs): included only when you @-mention the rule in chat.

The docs give one size limit: “Keep rules under 500 lines.” They also suggest splitting a large rule into smaller ones. Cursor does not state a hard technical cap.

Does Cursor have memories as well?

Older Cursor versions had a Memories feature that saved notes from chats. Cursor staff said on the Cursor forum that it was removed in version 2.1.x, and they suggested exporting the memories and moving them into Rules. The docs link for Memories now opens the Rules page. Treat rules you write as the supported way to keep instructions The AI coding agent memory guide covers the same change.

Where Hindsight fits

Cursor’s rules are text you maintain by hand, so they hold only what you wrote down. Hindsight is an open-source memory server that records what happened in each session. Its Coding Agents package has a Cursor CLI installer:

1npx @vectorize-io/hindsight-coding-agents install cursor-cli

According to Hindsight’s coding agents page, the installer writes hooks to ~/.cursor/hooks.json and MCP settings to ~/.cursor/mcp.json. Capture is automatic, and each repo gets one memory bank, coding-agent::{gitProject}, shared with the other agents that work in that repo. The same package covers 22 CLI agents in all, so one bank can hold Cursor and Claude Code sessions for the same project.

  • What it does not cover: the page documents Cursor CLI only, not the Cursor IDE. It also says past Cursor chats cannot be imported, because Cursor keeps its history in internal SQLite databases with unversioned schemas.
  • Cost: Hindsight calls an LLM on writes, so each captured session costs more than a line added to a .mdc file.
  • Vendor source: the Hindsight page is written by its maker. Test it on one repo before you rely on it.

For how the other coding agents keep their instructions, see AI coding agent memory. For Claude Code’s files, see Claude Code memory. For Codex, see Codex memory.

Sources