The memory we recommend for Cursor is Glen, shared memory for coding agents.Go to tryglen.com →
Setup2 min read

Glen, shared memory for coding agents

How to add memory to Cursor

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.

Get Glen for Cursor
On this page
  1. The hooks the plugin uses
  2. Getting the most from on-demand recall
  3. Recording controls
  4. Frequently asked questions
  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.
    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.
    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.
    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.
    glen search "why did we drop the websocket transport"

The hooks the plugin uses

Cursor hooks registered by Glen's plugin
Cursor hookFires
sessionStartWhen an agent session begins
beforeSubmitPromptBefore your prompt is sent
afterAgentResponseAfter the agent replies
afterShellExecutionAfter 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, 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
CommandWhat still happens
glen incognitoSearch works; nothing is recorded to team memory
glen silentSessions are recorded; nothing is surfaced
glen offNeither

Glen does not train AI models on customer content. Read Glen's Cursor docs for the details and the privacy policy 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.

More in this guide

Related guides on agent memory

Fix your agents’ amnesia.

Glen gives Cursor the memory of every session your team has run. Start on your own or with up to two teammates. Your first 15,000 memories are free, no credit card.

Start free at tryglen.com