memory · bhartendu-kumar, roo — Claude Code rule: project memory and setup
This rule organizes project memory across docs/, tasks/, and .cursor/rules/. It helps an agent retain plans, context, errors, and project decisions between tasks.
no license ★ 1,054 updated 2025-07-17
.claude/rules/memory.mdWhat memory does
The rule defines a file-based memory layout for a project. Seven core files cover different parts of the work: docs/product_requirement_docs.md stores requirements, docs/architecture.md describes the system, docs/technical.md records the stack and constraints, while tasks/tasks_plan.md and tasks/active_context.md track the backlog and current state. The .cursor/rules/ files keep reusable fixes and project lessons.
Work is split into PLAN and ACT modes. In PLAN, the agent reads the memory files, checks the context, and prepares an approach. In ACT, it updates the documentation, carries out the task, and records changes. Optional context can live under docs/literature/ and tasks/rfc/. The requested mode controls the workflow; when the request is unclear, the rule tells the agent to ask before proceeding.
For Claude Code, create .claude/rules/memory.md and place the rule there. Cline uses .clinerules/memory.md. The rule provides the structure, while the project files still need updates after meaningful changes.
What it helps with
- separate requirements from architecture notes
- track the task backlog and current project state
- record reusable fixes for later work
- capture project decisions and working preferences
- split planning from task execution
Example prompts for the agent
- Read the project memory files first and decide whether this request is PLAN or ACT mode.
- Update
tasks/tasks_plan.mdandtasks/active_context.mdafter completing this task. - Record this reusable fix in
.cursor/rules/error-documentation.mdc.
How to install memory
Manually: put the files in place
.claude/rules/memory.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/memory.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/memory.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/memory.mdManually: put the files in place
.clinerules/memory.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about memory
How do I install memory in Claude Code?
Create .claude/rules/memory.md and put the rule content in that file.
What does the memory rule do?
It sets up a file structure for requirements, architecture, technical context, tasks, and project lessons. The agent follows that structure in PLAN and ACT modes.
What belongs in the core memory structure?
The core set includes docs/product_requirement_docs.md, docs/architecture.md, docs/technical.md, tasks/tasks_plan.md, tasks/active_context.md, .cursor/rules/error-documentation.mdc, and .cursor/rules/lessons-learned.mdc. Extra context can go in docs/literature/ and tasks/rfc/.
Similar IDE rules
All IDE rules for Agent setup: memory, context, orchestration →memory by other authors comes first.