# How to add memory to Cursor

URL: https://cursormemory.com/setup
Last updated: 2026-11-07
Published by Glen (https://tryglen.com), shared memory for coding agents.

> Install the glen CLI with npx @tryglen/cli@latest install and sign in, then type /add-plugin in Cursor's agent chat and add https://github.com/Glen-Web-App/glen-cursor-plugin. The plugin's hooks record each session to your organization's memory. Cursor hooks can't add context to a turn, so recall is on demand: a bundled rule tells the agent to run glen search when a task touches past work.

1. **Install the CLI and sign in** You need Node.js. The installer sets up the `glen` command, which the plugin's hooks and rule both call, and opens a browser to sign you in or join your team's organization.

   ```bash
   npx @tryglen/cli@latest install
   ```
2. **Add the plugin from agent chat** Open Cursor's agent chat, type `/add-plugin`, and give it the plugin's repository URL.

   ```bash
   https://github.com/Glen-Web-App/glen-cursor-plugin
   ```
3. **Import past sessions** Optional. Backfilling your last 30 days of local sessions means `glen search` has answers on the first day.

   ```bash
   glen import
   ```
4. **Try a recall** Ask the agent about earlier work, or run a search yourself in the terminal. Expect a written answer with a citation for each claim in about 10 seconds.

   ```bash
   glen search "why did we drop the websocket transport"
   ```

## The hooks the plugin uses

*Cursor hooks registered by Glen's plugin*

| Cursor hook | Fires |
| --- | --- |
| `sessionStart` | When an agent session begins |
| `beforeSubmitPrompt` | Before your prompt is sent |
| `afterAgentResponse` | After the agent replies |
| `afterShellExecution` | After the agent runs a shell command |

Glen uses these to record the session. None of them can put text into the turn, which is why Glen in Cursor works differently from Glen in [Claude Code](https://claudecodememory.com), where memories arrive with every prompt.

## Getting the most from on-demand recall

- Say it outright when history matters: "check glen for how we handled this last time" makes a search far more likely.
- Run `glen search` in your own terminal while planning. Same memory, no agent required.
- Once an answer keeps coming up, promote it into a Project Rule so it applies without any search.
- Use `glen code-search` with a file path and line range to reach the conversations that wrote those lines.

## Recording controls

*Glen's recording modes*

| Command | What still happens |
| --- | --- |
| `glen incognito` | Search works; nothing is recorded to team memory |
| `glen silent` | Sessions are recorded; nothing is surfaced |
| `glen off` | Neither |

> **Add Glen to Cursor** Free for up to 3 people and 15,000 memories. No credit card. Install: `npx @tryglen/cli@latest install`. Start free at https://tryglen.com

Glen does not train AI models on customer content. Read [Glen's Cursor docs](https://tryglen.com/docs/cursor) for the details and the [privacy policy](https://tryglen.com/privacy) for how data is handled.

## Frequently asked questions

### Why doesn't Glen inject memory automatically in Cursor?

Cursor hooks can't add context to a turn. Glen records through the hooks and relies on a bundled rule that tells the agent to run glen search.

### Does the Cursor plugin need the glen CLI?

Yes. The hooks and the bundled rule call the glen command, so install it first with npx @tryglen/cli@latest install.

### Can I use Glen in Cursor through MCP instead?

Glen's remote MCP server at https://mcp.tryglen.com/mcp works with any MCP client, but MCP alone gives you search, not automatic recording. The plugin is what records your sessions.

### How long does a glen search take?

About 10 seconds. A language model writes the answer, so check the cited sources when it matters.
