sift-memory

A local-memory rule set that uses the sift command-line tool to search previous conversations from Claude Code, Codex, Cursor, and OpenCode. It can also show the surrounding details of selected results.

In plain words
What is it for?
For searching past coding-agent sessions by project, command, file, package, bug symptom, or decision, then reviewing relevant matching conversations.
Why use it?
It helps recover earlier decisions, implementation history, and project context instead of repeating work or guessing what was agreed.

Cursor rule for Cursor

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/roccodaffuso/sift/sift-memory
Clone the repo
git clone --depth 1 https://github.com/roccodaffuso/sift

Made for: Cursor.

Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 397 The whole file, excluding the scripts and references it only reads on demand.
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.00043 $0.00397
Opus 5 $0.00022 $0.00198
Sonnet 5 $0.00009 $0.00079
Haiku 4.5 $0.00004 $0.00040

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

Security

Grade A, and why

sift-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.

.cursor/rules/sift-memory.mdc · 43 lines

What it actually says

Sift Memory

Use sift as local memory search for prior AI coding-assistant sessions.

Commands

Prefer the installed CLI:

sift index --json
sift "<query>" --limit 10 --json
sift "<query>" --tool codex --limit 10 --json
sift "<query>" --tool claude --limit 10 --json
sift "<query>" --tool cursor --limit 10 --json
sift "<query>" --tool opencode --limit 10 --json
sift show "<ref>" --json
sift list --limit 10 --json

When working inside the sift repo and the global command is unavailable, use:

node ./bin/sift.js index --json
node ./bin/sift.js "<query>" --limit 10 --json
node ./bin/sift.js show "<ref>" --json
node ./bin/sift.js list --limit 10 --json

Use sift index --full only when the user asks, parser/index behavior changed, or incremental results look stale.

Behavior

  • Search before answering when local session history could materially improve accuracy.
  • Use focused queries based on project names, command names, file names, bug symptoms, package names, or prior decisions.
  • Follow only relevant search refs with sift show when surrounding messages are needed.
  • Summarize only relevant findings. Do not paste large raw logs.
  • Keep the workflow local: no network calls, no telemetry, no sync, no writes to Claude Code, Codex, Cursor, or OpenCode source logs/databases.
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 · 43 lines · 43 tokens per session scan A 2501f0c156c9

Subscribe to this mod's changes

sift-memory is a cursor rule published in the GitHub repository roccodaffuso/sift (2 stars, last pushed 29d ago), licensed MIT. It adds 43 tokens to every session and 397 once invoked, about $0.0002 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-31.