Skip to content

feat: deliver memory to Cursor as a reflex-memory skill (#76) - #152

Merged
NehharShah merged 1 commit into
mainfrom
feat/cursor-memory
Nov 20, 2026
Merged

NehharShah merged 1 commit into
mainfrom
feat/cursor-memory

Conversation

@NehharShah

Copy link
Copy Markdown
Collaborator

What changed and why

memoryTargets() wrote memory only to Claude Code and Codex; Cursor — often where most sessions happen — got nothing, because Cursor keeps user rules in its app settings, not a file. The delivery for Cursor is a skill: ~/.cursor/skills/reflex-memory/SKILL.md, owned by Reflex the same way the blocks are.

The file: front matter that makes Cursor load it (name: reflex-memory, a description of what it holds) plus the same marked block the other agents get — so the markers, the "edits inside this block are replaced" contract, and the rendering stay identical across all three targets. memory on writes it, add/forget update it, it refreshes after every scan (the same syncMemory call), and memory off/reset delete it.

Ownership rules (the issue's "owned the same way"):

  • a reflex-memory/SKILL.md that does not carry Reflex's markers is never overwritten — reported as "exists and is not Reflex's";
  • a symlinked file is never written through (same as everywhere);
  • other skills in ~/.cursor/skills are never touched; off removes the file and its folder only when the folder is empty;
  • MemoryTarget gains a kind ("block" | "skill") so the delivery difference is explicit rather than an id string-compare, and syncMemory passes the active entries through so the skill is rendered from the rules themselves (no render-then-re-parse round trip, which could corrupt a rule that legitimately ends in "(N sessions)").

memory on's wording now says what Cursor gets, and its "nothing found" message includes ~/.cursor.

Docs

docs/security.md (the Agent memory row: the Cursor skill, whole-file ownership, the not-ours guard), docs/commands.md (the memory line), README (feature list, command table, FAQ entry).

Testing

pnpm lint, pnpm typecheck, pnpm build, pnpm test: 749 passed, 18 skipped.

memory.test.ts gains: the skill written with front matter and the block while a sibling skill stays byte-identical; add/forget update it; a rescan refreshes it; off deletes the file and the emptied folder while the sibling survives; and a foreign reflex-memory skill is skipped, not overwritten.

Cursor keeps user rules in its app settings, not a file, so the memory target
is a skill: ~/.cursor/skills/reflex-memory/SKILL.md, front matter plus the
same marked block the other agents get. The file is owned wholly by Reflex:
a file without Reflex's markers is never overwritten, memory off deletes it
(and its folder, when no other skill needs it), and other skills in the
folder are untouched. Refreshed after every scan like the other targets.
@NehharShah
NehharShah merged commit e35aa57 into main Nov 20, 2026
2 checks passed
@NehharShah
NehharShah deleted the feat/cursor-memory branch November 20, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant