project-memory

project-memory is a cursor rule for Cursor from HoangP8/tokless. It costs 563 tokens per session, scanned A, original, MIT.

A project-memory rule set for recording bugs, attempted fixes, proven fixes, design decisions, and useful notes in a .projectmem directory. It preserves the history of what happened across coding sessions.

In plain words
What is it for?
Use it to log an issue when a bug or investigation appears, record each fix attempt and its outcome, close a fix when evidence exists, and save decisions or gotchas for future contributors.
Why use it?
It prevents important discoveries and decisions from being lost between sessions. Recording evidence for fixes and marking superseded decisions helps keep the project history trustworthy.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to log an issue when a bug or investigation appears, record each fix attempt and its outcome, close a fix when evidence exists, and save decisions or gotchas for future contributors.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/hoangp8/tokless/project-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/HoangP8/tokless

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 project-memory

README.md
[![agentmods](https://agentmods.dev/badge/rules/hoangp8/tokless/project-memory/github.svg)](https://agentmods.dev/rules/hoangp8/tokless/project-memory)
Your own site
<a href="https://agentmods.dev/rules/hoangp8/tokless/project-memory"><img src="https://agentmods.dev/badge/rules/hoangp8/tokless/project-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 project-memory

Your own site · 80×15
<a href="https://agentmods.dev/rules/hoangp8/tokless/project-memory"><img src="https://agentmods.dev/badge/rules/hoangp8/tokless/project-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 563 This file is loaded in full into every session.
When invoked 563 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.00563 $0.00563
Opus 5.5 $0.00225 $0.00225
Sonnet 5.5 $0.00113 $0.00113
Haiku 4.5 $0.00056 $0.00056

Measured 11d ago against content hash 27213061b202, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

project-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 11d 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.

.cursor/rules/project-memory.mdc · 40 lines

How it starts

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

Project Memory (projectmem)

MCP tools record what broke, what was tried, and what was decided, across sessions, in .projectmem/.

Rules

Event Tool Rule
Bug found log_issue Trigger: bug, unclear behavior, hypothesis, or investigation topic.
Fix tried record_attempt outcome: worked, failed, or partial. One call per attempt.
Fix proven record_fix Needs evidence: test passes, error gone, or user confirms. Closes issue.
Design choice add_decision Replaces older decision: set supersedes to old event id — the old one retires from the summary, history is never rewritten; two disagreeing decisions corrupt trust.
Gotcha found add_note Prefix gotcha:. Shared across projects. Also use for notes and key files future contributors should read first.
  • Log as soon as a trigger fires — before any other work.
  • One call per event, decisions and gotchas alike; never batch writer calls.
  • Use only the fixed event vocabulary; never invent new event types.
  • Log every fix, small ones too. Keep entries short and specific: file, error, test name.
  • All writers accept location: "file:line".
  • Never log secrets, credentials, customer data, tokens, or large transcripts.
  • Edit PROJECT_MAP.md and plan.md directly. Never log plans as events — a user's idea or plan belongs in plan.md.
  • Never edit summary.md (derived) or events.jsonl (append-only). Stale detail there → record the correction with a writer tool.
  • Superseding a decision? Get the old event id from events.jsonl, pass it as supersedes.
  • Trust recorded memory over recall; don't re-derive answers by re-reading summary.md or source files.
  • Before exiting: memory must reflect what actually happened.

Examples

log_issue(summary: "JWT parse fails on expired token", location: "auth/middleware.go:42")
record_attempt(summary: "Moved expiry check before signature verify", outcome: "failed", issue_id: "0001")
record_fix(summary: "Use leeway comparison at boundary", issue_id: "0001")
add_decision(summary: "Use pgx pool over database/sql", supersedes: "<old event id>")
add_note(summary: "gotcha: local CI skips integration tests without TEST_DB set")

Read the full file on GitHub · 40 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. 11d ago First seen · 40 lines · 563 tokens per session scan A 27213061b202

Subscribe to this mod's changes

project-memory is a cursor rule published in the GitHub repository HoangP8/tokless (289 stars, last pushed today), licensed MIT. It adds 563 tokens to every session, about $0.0023 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-10-05.