How to add Cline Memory Bank feature to your cursor

This is how to add cursor version’s cline memory bank.

1. Add Plan/Act modes to cursor agent.

the cursor rule for that modes is here. thank you DaleLJefferson!!

  1. Create .cursor/rules/core.mdc
---
description: 
globs: 
alwaysApply: true
---
## Core Rules

You have two modes of operation:

1. Plan mode - You will work with the user to define a plan, you will gather all the information you need to make the changes but will not make any changes
2. Act mode - You will make changes to the codebase based on the plan

- You start in plan mode and will not move to act mode until the plan is approved by the user.
- You will print `# Mode: PLAN` when in plan mode and `# Mode: ACT` when in act mode at the beginning of each response.
- Unless the user explicity asks you to move to act mode, by typing `ACT` you will stay in plan mode.
- You will move back to plan mode after every response and when the user types `PLAN`.
- If the user asks you to take an action while in plan mode you will remind them that you are in plan mode and that they need to approve the plan first.
- When in plan mode always output the full updated plan in every response.

2. Add Memory Bank to cursor agent

And this is the cursor version of the cline’s memory bank rule. Thank you cline!

  1. Create .cursor/rules/memory-bank.mdc
---
description: 
globs: 
alwaysApply: true
---
# Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

## Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

\```mermaid
flowchart TD
    PB[projectbrief.md] --> PC[productContext.md]
    PB --> SP[systemPatterns.md]
    PB --> TC[techContext.md]
    
    PC --> AC[activeContext.md]
    SP --> AC
    TC --> AC
    
    AC --> P[progress.md]
\```

### Core Files (Required)
1. `projectbrief.md`
   - Foundation document that shapes all other files
   - Created at project start if it doesn't exist
   - Defines core requirements and goals
   - Source of truth for project scope

2. `productContext.md`
   - Why this project exists
   - Problems it solves
   - How it should work
   - User experience goals

3. `activeContext.md`
   - Current work focus
   - Recent changes
   - Next steps
   - Active decisions and considerations

4. `systemPatterns.md`
   - System architecture
   - Key technical decisions
   - Design patterns in use
   - Component relationships

5. `techContext.md`
   - Technologies used
   - Development setup
   - Technical constraints
   - Dependencies

6. `progress.md`
   - What works
   - What's left to build
   - Current status
   - Known issues

### Additional Context
Create additional files/folders within memory-bank/ when they help organize:
- Complex feature documentation
- Integration specifications
- API documentation
- Testing strategies
- Deployment procedures

## Core Workflows

### Plan Mode
\```mermaid
flowchart TD
    Start[Start] --> ReadFiles[Read Memory Bank]
    ReadFiles --> CheckFiles{Files Complete?}
    
    CheckFiles -->|No| Plan[Create Plan]
    Plan --> Document[Document in Chat]
    
    CheckFiles -->|Yes| Verify[Verify Context]
    Verify --> Strategy[Develop Strategy]
    Strategy --> Present[Present Approach]
\```

### Act Mode
\```mermaid
flowchart TD
    Start[Start] --> Context[Check Memory Bank]
    Context --> Update[Update Documentation]
    Update --> Rules[Update .cursor/rules if needed]
    Rules --> Execute[Execute Task]
    Execute --> Document[Document Changes]
\```

## Documentation Updates

Memory Bank updates occur when:
1. Discovering new project patterns
2. After implementing significant changes
3. When user requests with **update memory bank** (MUST review ALL files)
4. When context needs clarification

\```mermaid
flowchart TD
    Start[Update Process]
    
    subgraph Process
        P1[Review ALL Files]
        P2[Document Current State]
        P3[Clarify Next Steps]
        P4[Update .cursor/rules]
        
        P1 --> P2 --> P3 --> P4
    end
    
    Start --> Process
\```

Note: When triggered by **update memory bank**, I MUST review every memory bank file, even if some don't require updates. Focus particularly on activeContext.md and progress.md as they track current state.

## Project Intelligence (.cursor/rules)

The .cursor/rules file is my learning journal for each project. It captures important patterns, preferences, and project intelligence that help me work more effectively. As I work with you and the project, I'll discover and document key insights that aren't obvious from the code alone.

\```mermaid
flowchart TD
    Start{Discover New Pattern}
    
    subgraph Learn [Learning Process]
        D1[Identify Pattern]
        D2[Validate with User]
        D3[Document in .cursor/rules]
    end
    
    subgraph Apply [Usage]
        A1[Read .cursor/rules]
        A2[Apply Learned Patterns]
        A3[Improve Future Work]
    end
    
    Start --> Learn
    Learn --> Apply
\```

### What to Capture
- Critical implementation paths
- User preferences and workflow
- Project-specific patterns
- Known challenges
- Evolution of project decisions
- Tool usage patterns

The format is flexible - focus on capturing valuable insights that help me work more effectively with you and the project. Think of .cursor/rules as a living document that grows smarter as we work together.

REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank is my only link to previous work. It must be maintained with precision and clarity, as my effectiveness depends entirely on its accuracy.

3. Setup Memory Bank

finally, follow the instructions.

  1. Create a memory-bank/ folder in your project root
  2. Ask Cursor agent to initialize memory bank

and,

Have a happy dev life!!!

10 Likes

I tried it, works very good so far. Thanks for sharing!

1 Like

Maybe a dumb question, but how do I Create .cursor/rules/memory-bank.mdc? Thank you!

1 Like

how about this?

  1. create .cursor/rules/memory-bank.md (without c)
  2. copy and paste the rule
  3. rename the file to .cursor/rules/memory-bank.mdc

Thank you so much! Just realized that I was using an old version of cursor. Updated to 0.45 and found project roles. Appreciate that!

1 Like

hi, the rule works for your project well?

for my project, sonnet 3.7 ignores the rules sometimes…

how about it in your development?

that’s great!!

when you try the memory bank and you have a room, let me know about how the feature works for your project. I wanna know how this feature works.

for my project, sonnet 3.7 ignores the rules sometimes. I don’t know why. maybe, the context window might be limited..?? or just the intelligence is not enough..?
I’m searching for the better usage of the rules now!!

very useful

1 Like


But what are you doing when Cursor continuously ignore rule’s reading? :man_facepalming:

1 Like

hmm, maybe, I should explicitly tell the agent to be plan mode at first.

like

Plan mode

write a unit test.

and I found that tells the agent that enter a memory bank plan mode first. this works well.

You can change the “Rule Type” to “Always”.
Then don’t need manual operate mention it.

1 Like

Yes always if it applies for every single prompt in your project or write a detailed description when to use it for the description field if you want to use it e.g. only in plan mode. Like “Apply plan mode rule every time you are in plan mode” or with glob by file extension like *.css

Sometimes it may need also a cursor restart, a few people posted about this and i hope the cursor team can reproduce it/fix it.

1 Like

do i need to install cline in cursor?

1 Like

no you don’t

But to be honest, I don’t think cline’s Plan/Act mode works very well for me. If it’s a large functional change, I want it to execute according to the plan after writing the plan, but it either deviates from the plan and makes changes I don’t want, or it doesn’t follow the planned path step by step and stops halfway. And if I use my brain to split a large functional change into a step-by-step plan, it will be faster to direct it to modify it directly.
As for the Memory Bank, except that it records my project at initialization, it doesn’t seem to be called by the cursor at all in subsequent interactions.
I really think the Plan/Act mode + memory bank process is a waste of money and time. Is it because I’m using it the wrong way? :smiling_face_with_tear:

2 Likes

You can break down a complex plan into steps and ask it to do only step 1, then if that is complete it should update the plan progres, then go to step two (even if you have to start new chat and attach the plan again) it will know better where to continue from

1 Like

Does each step of the plan need to be detailed enough and have the possibility of direct execution? Even need to be precise to specify the calling and constraint conditions of a certain function and its modification methods?
When I used Plan/Act before, I always encountered situations where it didn’t fully understand the calling and constraints of functions, which led to program crashes.
But this might also be because I let the cursor follow the plan step by step without specifying that it should only complete one step… I’ll try to constrain it to only complete one step in the plan.

1 Like

That depends really on the task.

For simple tasks or where code and requirements are very clear i need just to ask AI to do it and explain what is required.

For complex tasks i have to break it down. sometimes even into separate tasks with its own steps.

The clearer details you have, if they are not clear from existing code, the better AI will be able to do the task.

Again, if there is code already that has to be called you dont need to specify all details if you mention which functions you want to be used or if AI knows which ones apply.

1 Like

thx :grinning_face:
btw, do you have any suggestions on how to use Memory Bank? Except recording my project at initialization, it doesn’t seem to be called at all in subsequent interactions.

1 Like