Skip to content

Integration guide

OpenReflex for Cursor

OpenReflex uses Cursor's agent hooks and MCP support to learn from each task in your project and bring what worked into the next one.

What OpenReflex adds to Cursor

Context on the first tool result

Cursor cannot add context when a prompt is submitted, so OpenReflex delivers it with the agent's first tool result instead.

Alerts where Cursor listens

Loop and stagnation alerts are returned as additional context after tool calls.

No double counting

If Cursor also runs Claude Code hook configs, those events are attributed to Cursor and de-duplicated.

Install OpenReflex for Cursor

  1. 1

    Install the OpenReflex CLI (Python 3.11 or newer)

    $pipx install openreflex
  2. 2

    Write hooks to .cursor/hooks.json and the MCP server to .cursor/mcp.json

    $openreflex install cursor

Check the setup any time with openreflex doctor. Nothing is recorded until a project is enabled.

How it works in Cursor

Hook eventWhat OpenReflex does
beforeSubmitPromptStarts a task; the Execution Context is held until the first tool result.
preToolUse / postToolUseRecords each tool call and returns context or alerts after it.
postToolUseFailureRecords the failure and a masked error signature.
stop / sessionEndWorks out the outcome and stores lessons.
  • OpenReflex never grants or denies tool permissions in Cursor; it only observes and advises.
  • The Cursor integration follows Cursor's documented hook protocol and is covered by OpenReflex's protocol and fuzz tests.

Common questions

Why does context appear after the first tool call?
Cursor's beforeSubmitPrompt hook cannot inject context, so the first tool result is the earliest point OpenReflex can reach the model.
Does it work with other agents in the same repo?
Yes. Cursor shares one local Experience Graph with Claude Code, Codex and OpenCode.

Other integrations

Full CLI and MCP reference in the docs, and the source on GitHub.