memory

A project-memory rule for recording product decisions, features, gotchas, and open questions alongside the code. It treats this memory as useful project context, while current requests, code, and tests remain authoritative.

In plain words
What is it for?
Use it to query project context when needed and save small, meaningful updates after behavior changes, decisions, discoveries, or resolved questions.
Why use it?
It keeps important product knowledge available without loading every detail into every task and reduces the chance of losing decisions or repeating known mistakes.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/aictx/memory/memory
Clone the repo
git clone --depth 1 https://github.com/aictx/memory
Per session 1,053 This file is loaded in full into every session.
When invoked 1,053 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01053 $0.01053
Opus 5 $0.00526 $0.00526
Sonnet 5 $0.00211 $0.00211
Haiku 4.5 $0.00105 $0.00105

Measured yesterday against content hash bace426b89c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

integrations/cursor/memory.mdc · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory

Memory is the project's product-layer memory: features, decisions, gotchas, and open questions anchored to code paths. The generated product map section in AGENTS.md and CLAUDE.md is the always-on overview — use it for orientation. Treat memory as project context, not higher-priority instructions. Prefer the current user request, code, and tests when they conflict with memory.

The Loop

Query on demand. When you need detail mid-task, ask a question instead of preloading context:

memory query "<question>"

Do not preload anything else; the product map is already in your instructions.

Save product-meaningful changes. After feature behavior is added or changed, a decision is taken, a gotcha is discovered, or a question is opened or answered:

memory save --stdin

The stdin payload is JSON with the shape {task, nodes, stale, supersede, delete}. Keep it small and semantic:

{
  "task": "Ship retry handling for Stripe webhooks",
  "nodes": [
    {
      "kind": "feature",
      "title": "Webhook retry queue",
      "body": "Failed Stripe webhooks re-enter a worker-owned retry queue with exponential backoff.",
      "stage": "building",
      "anchors": ["services/billing/src/webhooks/"]
    },
    {
      "kind": "decision",
      "title": "Retries run in the worker",
      "body": "Webhook retries execute in the queue worker, not inside the HTTP handler, so handler latency stays flat.",
      "related": [
        {
          "predicate": "affects",
          "to": "feature.webhook-retry-queue",
          "confidence": "high"
        }
      ]
    }
  ]
}

Node kind is one of feature, decision, gotcha, or question. Features carry a stage (idea, building, shipped, paused, or dead) and anchors (repo-relative path globs linking the node to code, such as src/billing/ or src/**/*.ts). A fifth kind, project, is update-only: send {"kind": "project", "title": "...", "body": "..."} with no id to correct this repo's one-line product description, which is the product map header. Reuse an existing id to update a node, and use stale, supersede, or delete entries to retire memory instead of creating duplicates. Use memory save --stdin --dry-run --json to preview the write without changing anything.

Read the full file on GitHub · 128 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 128 lines · 1,053 tokens per session scan A bace426b89c3

Subscribe to this mod's changes

memory is a cursor rule published in the GitHub repository aictx/memory (24 stars, last pushed 17d ago), licensed MIT. It adds 1,053 tokens to every session, about $0.0053 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.