Skip to main content
rule CX Codex

memory · bhartendu-kumar, cursor — Claude Code & Cline rule: project memory files

Keeps project memory in a fixed set of files the agent reads before work: requirements, architecture, stack, task plan, current state.

no license ★ 1,054 updated 2025-07-17

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/memory.mdc
Open on GitHub

What memory does

Seven files carry the memory: a requirements doc, architecture, the technical stack, a task backlog, the current working state, and two journals for mistakes and for lessons. The rule lays them out as a hierarchy, with a mermaid diagram showing what builds on what.

Work runs in one of two modes. Plan mode reads docs/ and tasks/, checks whether anything is missing and brings you a strategy to approve. Act mode refreshes the docs first and only then touches code. You can name the mode outright with MODE = ACT MODE, otherwise the agent infers it and asks when the request is unclear. Expect an extra question at the start of a session.

The whole scheme depends on the files being there. Without them plan mode has nothing to read and starts by drafting the set, including the PRD at project start. Asking the agent to update memory files makes it go through every core file again, which is how the picture stays current.

What it helps with

  • keep requirements and architecture in files the agent reads first
  • pick a task back up after a session restart
  • log a fix so the same mistake is not repeated
  • separate planning from code edits
  • keep RFCs and literature notes next to the task plan

Example prompts for the agent

  • MODE = PLAN MODE: read the memory files in docs/ and tasks/, then propose a plan.
  • Update memory files: go through tasks/active_context.md and tasks/tasks_plan.md.
  • Write that fix into .cursor/rules/error-documentation.mdc before you continue.

How to install memory

Manually: put the files in place

.cursor/rules/memory.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about memory

How do I install memory in Claude Code?

Put the rule file at .claude/rules/memory.md. The frontmatter sets alwaysApply: true, so it fires on every request.

What does the memory rule do?

It defines which files hold the project memory, in what order the agent reads them and when it writes updates back.

What if the memory files do not exist yet?

Plan mode drafts them before anything else. The PRD is created at project start when it is missing.

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

memory by other authors comes first.

memory Bhartendu-Kumar This rule organizes project memory across docs/, tasks/, and .cursor/rules/. It helps an agent retain plans, context, errors, and project decisions between tasks. CX Codex +1 ★ 1,054repo stars story-memory haowjy The story-memory Claude Code skill preserves and retrieves information from a fiction project. It comes into play when passing context between writing tasks or maintaining persistent story notes. CX Codex +1 606installs notion-memory MSApps-Mobile notion-memory is a Claude Code plugin that maintains persistent context across sessions inside Notion. It logs decisions, technical preferences, and conversation summaries. ★ 11repo stars remember Yeachan-Heo remember is a Claude Code skill that sorts session knowledge into the right place. It activates when useful findings need to be preserved or organized. CX Codex +1 695installs memory-discipline rohitg00 memory-discipline — a skill for Claude Code, Cursor and other platforms that retrieves prior context at task start, stores decisions the moment they settle, and learns from corrections. CX Codex +1 4,900installs OMEGA Memory omega-memory OMEGA Memory — an MCP server that gives a coding agent long-term memory for decisions, mistakes and task checkpoints, found later by meaning or through the graph. CX Codex +1 2,862installs claude-memory-curator stark-ai-de The claude-memory-curator Claude Code skill reviews instructions, rules, and auto-memory for stale or conflicting entries. It helps sort out persistent Claude Code context and decide what to keep, move, or clean up. CX Codex +1 2,700installs

From the same set11

The whole set →

Project sponsors

Companies that keep this analytics open