mem

mem is a command for Claude Code from sdsrss/claude-mem-lite. It costs 16 tokens per session (782 once invoked), scanned A, original, MIT.

A group of commands for searching and managing a project's saved memory and history. It can find notes, show recent observations, trace a file's history, and remove old entries.

In plain words
What is it for?
Use it to search project memories, review recent findings, inspect what was recorded about a file, browse a timeline, save notes, view memory statistics, or clean up stale records.
Why use it?
It reduces the need to repeat earlier investigation and helps recover context from past work.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the claude-mem-lite plugin — 8 commands, 7 hooks, 1 MCP server shipped together

Good fit Use it to search project memories, review recent findings, inspect what was recorded about a file, browse a timeline, save notes, view memory statistics, or clean up stale records.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add sdsrss/claude-mem-lite
Claude Code
/plugin install claude-mem-lite

Made for: Claude Code.

Or install claude-mem-lite, the plugin that ships this one along with the rest of its 8 commands, 7 hooks, 1 MCP server.

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 mem

README.md
[![agentmods](https://agentmods.dev/badge/commands/sdsrss/claude-mem-lite/mem/github.svg)](https://agentmods.dev/commands/sdsrss/claude-mem-lite/mem)
Your own site
<a href="https://agentmods.dev/commands/sdsrss/claude-mem-lite/mem"><img src="https://agentmods.dev/badge/commands/sdsrss/claude-mem-lite/mem/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 mem

Your own site · 80×15
<a href="https://agentmods.dev/commands/sdsrss/claude-mem-lite/mem"><img src="https://agentmods.dev/badge/commands/sdsrss/claude-mem-lite/mem.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 782 The whole file, excluding the scripts and references it only reads on demand.
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.00016 $0.00782
Opus 5.5 $0.00006 $0.00313
Sonnet 5.5 $0.00003 $0.00156
Haiku 4.5 $0.00002 $0.00078

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

Security

Grade A, and why

mem 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 2d 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.

commands/mem.md · 39 lines

How it starts

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

Memory

Search and browse your project memory efficiently.

Quick Commands

  • /mem search <query> — Search all memories (FTS5 full-text search)
  • /mem recent [n] — Show recent N observations (default 5)
  • /mem recall <file> — History for a file before editing
  • /mem timeline <id> — Browse timeline around an observation
  • /mem save <text> — Save a manual memory/note
  • /mem stats — Show memory statistics
  • /mem cleanup — Scan and interactively purge stale data
  • /mem cleanup [N]d — Purge stale data older than N days (e.g. cleanup 60d)
  • /mem cleanup keep [N]d — Purge stale data but retain last N days (e.g. cleanup keep 14d)

Instructions

When the user invokes /mem, parse their intent:

  • /mem search <query> → run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" search <query> via Bash
  • /mem recent or /mem recent 20 → run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" recent [N] via Bash
  • /mem recall <file> → run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" recall <file> via Bash
  • /mem timeline <id> → run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" timeline --anchor <id> via Bash
  • /mem save <text> → call mem_save MCP tool with the text as content
  • /mem stats → run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" stats via Bash
  • /mem get <ids> → run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" get <ids> via Bash
  • /mem cleanup → run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" maintain scan via Bash and report the pending purge and stale counts to the user. Then run the purge command below without --confirm first: it prints how many rows it would delete and deletes nothing. If that count is 0, tell the user nothing is old enough to purge yet and stop. Otherwise report that count, not the scan's pending count, which includes rows too recent to purge. Ask for confirmation, and if confirmed run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" maintain execute --ops purge_stale --confirm via Bash. --confirm is required and is not optional politeness: without it the command prints a dry-run PREVIEW and deletes nothing, while still succeeding — so you would report a cleanup that never happened.
  • /mem cleanup Nd (e.g. 60d) → same as above but add --retain-days N to both purge runs to only purge items older than N days. --retain-days must be between 7 and 365; the CLI rejects anything outside that range, so /mem cleanup 3d cannot be honoured — say so rather than silently substituting the default.
  • /mem cleanup keep Nd (e.g. keep 14d) → same as above with --retain-days N, same 7–365 range.
  • /mem <query> (no subcommand) → treat as search, run node "${CLAUDE_PLUGIN_ROOT}/cli.mjs" search <query> via Bash

Read the full file on GitHub · 39 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. 2d ago Changed 9aa35695eccb
  2. 3d ago Changed cab456eda2fd
  3. 27d ago Changed b4fbb5b2ffcf
  4. 1mo ago Changed 9e5a9a19a3b6
  5. 1mo ago First seen · 39 lines · 16 tokens per session scan A 07adcf705b38

Subscribe to this mod's changes

mem is a command published in the GitHub repository sdsrss/claude-mem-lite (67 stars, last pushed today), licensed MIT. It adds 16 tokens to every session and 782 once invoked, about $0.0001 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.