memorywhale

memorywhale is a cursor rule for Cursor from wuisabel-gif/MemWhale. It costs 78 tokens per session (488 once invoked), scanned A, original, MIT.

A memory system for debugging history. It records terminal commands, their results, errors, and lessons in a local database so they can be found later.

In plain words
What is it for?
Searching for earlier errors, retrieving past debugging context, and saving the cause and fix of a failure.
Why use it?
It avoids repeating investigations when the same build, test, or deployment problem has happened before.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

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/wuisabel-gif/memwhale/memorywhale
Clone the repo
git clone --depth 1 https://github.com/wuisabel-gif/MemWhale

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 memorywhale

README.md
[![agentmods](https://agentmods.dev/badge/rules/wuisabel-gif/memwhale/memorywhale.svg)](https://agentmods.dev/rules/wuisabel-gif/memwhale/memorywhale)
Your own site
<a href="https://agentmods.dev/rules/wuisabel-gif/memwhale/memorywhale"><img src="https://agentmods.dev/badge/rules/wuisabel-gif/memwhale/memorywhale.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 488 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.1 $0.00078 $0.00488
Opus 5 $0.00039 $0.00244
Sonnet 5 $0.00016 $0.00098
Haiku 4.5 $0.00008 $0.00049

Measured 6d ago against content hash 9618061ff83d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

memorywhale 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 6d 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.

integrations/cursor/memorywhale.mdc · 43 lines

What it actually says

MemoryWhale memory

MemoryWhale records terminal commands, their arguments, exit codes, output, and errors into a local SQLite database — the record of what was already tried, surviving crashes, SSH drops, and switching machines. It also holds freeform lessons a human or a past agent chose to remember.

You reach it through the memorywhale MCP server (tools: recent_errors, search_memory, get_context, remember). If the MCP server isn't connected, shell out to the mw CLI instead.

When to READ from it

  • A build/test/deploy is failing and it might have failed before.
  • You need the exact earlier error text, flags, or working directory — not a paraphrase.
  • The user references past work ("last week", "on the Jetson", "how did I fix").

Before proposing a fix for a failure, check whether it already has a known cause: call search_memory / recent_errors (or mw context --last-error / mw search "<error text>"). If a remembered lesson matches, say so and apply it rather than re-deriving from scratch.

When to WRITE to it

Once you've figured out why something failed or how a fix worked — not just that it's fixed — save it with the remember tool (or mw remember "<text>"). Keep it a self-contained conclusion: what was wrong + what fixed it, e.g. "the E0308 in camera-driver was the fps field being a string; fix: parse as i32". That's the part a raw command log doesn't capture, and it's what saves the next session from re-deriving the same thing.

Note

Captured output is secret-redacted on the way in, but treat it as real project data. Everything is local — nothing is uploaded.

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. 6d ago First seen · 43 lines · 78 tokens per session scan A 9618061ff83d

Subscribe to this mod's changes

memorywhale is a cursor rule published in the GitHub repository wuisabel-gif/MemWhale (52 stars, last pushed 2d ago), licensed MIT. It adds 78 tokens to every session and 488 once invoked, about $0.0004 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.