persistent-memory

persistent-memory is a cursor rule for Cursor from coco-research/coco. It costs 942 tokens per session, scanned A, original, Apache-2.0.

A set of rules for loading and updating notes that remain available between coding sessions.

In plain words
What is it for?
Keeping a continuing record of project information across sessions.
Why use it?
It reduces the need to repeat project context each time work resumes.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: reads .claude/ paths; mentions CLAUDE.md.

Good fit Keeping a continuing record of project information across sessions.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/coco-research/coco/persistent-memory
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.

Clone the repo
git clone --depth 1 https://github.com/coco-research/coco

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for persistent-memory

README.md
[![agentmods](https://agentmods.dev/badge/rules/coco-research/coco/persistent-memory/github.svg)](https://agentmods.dev/rules/coco-research/coco/persistent-memory)
Your own site
<a href="https://agentmods.dev/rules/coco-research/coco/persistent-memory"><img src="https://agentmods.dev/badge/rules/coco-research/coco/persistent-memory/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for persistent-memory

Your own site · 80×15
<a href="https://agentmods.dev/rules/coco-research/coco/persistent-memory"><img src="https://agentmods.dev/badge/rules/coco-research/coco/persistent-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 942 This file is loaded in full into every session.
When invoked 942 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00942 $0.00942
Opus 5.5 $0.00377 $0.00377
Sonnet 5.5 $0.00188 $0.00188
Haiku 4.5 $0.00094 $0.00094

Measured 2mo ago against content hash 7ca3c0bdbf01, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

persistent-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 2mo ago.

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.

rules/cursor-mdc/persistent-memory.mdc · 122 lines

How it starts

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

Persistent Memory Protocol

Session Start (CRITICAL)

Before ANY work, read both memory files:

  1. ~/.claude/CLAUDE.md — Global memory (cross-project patterns)
  2. ./CLAUDE.local.md — Local memory (project-specific)

Multi-project workspaces: If the workspace contains multiple project folders, each project should have its own CLAUDE.local.md inside its folder. The workspace root CLAUDE.local.md tracks standalone tasks only. When working on a specific project, read that project's local memory file (e.g., ./ProjectName/CLAUDE.local.md).

If ./CLAUDE.local.md doesn't exist, create it immediately using the Local Memory Template below.

Continuous Local Memory Updates

Update ./CLAUDE.local.md IMMEDIATELY after:

Trigger What to Log
Code change File modified, what changed, why
New file created Purpose, location, dependencies
Bug fixed Root cause, solution, prevention
Feature added What it does, where it lives
Refactor What changed, before/after pattern
Dependency added Package name, version, why needed
Config change What setting, old → new value
API endpoint Route, method, purpose
Decision made Choice, alternatives considered, rationale

Format:

## Recent Changes

- [YYYY-MM-DD HH:MM] `path/to/file.ts` — Added error handling for API timeout
- [YYYY-MM-DD HH:MM] `package.json` — Added [email protected] for HTTP requests

Global Memory Updates

Update ~/.claude/CLAUDE.md when patterns are reusable:

  • New tool/skill installed
  • Cross-project convention established
  • Lesson learned applicable everywhere
  • Workflow optimization discovered

Local Memory Template

# Project Memory — {Project Name}

## Overview
- Purpose:
- Stack:
- Started: [YYYY-MM-DD]

## Architecture
- Entry:
- Structure:

## Key Decisions
<!-- Log every significant choice -->

## Recent Changes
<!-- Updated continuously with each code change -->

## Open Questions
<!-- Unresolved items -->

## Commands
- Dev:
- Build:
- Test:

Read the full file on GitHub · 122 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. 2mo ago Changed · +49 tokens per session 7ca3c0bdbf01
  2. 3mo ago First seen · 122 lines · 893 tokens per session scan A d910973e5fb2

Subscribe to this mod's changes

persistent-memory is a cursor rule published in the GitHub repository coco-research/coco (323 stars, last pushed yesterday), licensed Apache-2.0. It adds 942 tokens to every session, about $0.0038 per session on Opus 5.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.

Related

persistent-memory compared with cursor rules from other repositories

persistent-memory next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
persistent-memorycoco-research/cocoCursor rule323yesterdayApache-2.0A942Cursor
context-bankkadiresen/context-bankCursor rule91mo agoMITA83Cursor
error-logsordi-ai/skill-everythingCursor rule216mo agoMITA26Cursor
obsidian-memoryVahlame/create-vkm-kitCursor rule429d agononeA166Cursor
agent-context-doctordadion123/agent-context-doctorCursor rule15mo agoMITA48Cursor
kolorpiecioshka/whose-context-winsCursor rule21mo agononeA26Cursor
deepinit-leandeepfusionlabs/deep-initCursor rule62mo agoMITA1,693Windsurf