mnemosyne: Command for Claude Code

.claude/commands/memory-context.md

memory-context is a command for Claude Code from rand/mnemosyne. It costs 9 tokens per session (711 once invoked), scanned A, original, MIT.

A command that loads saved project context from Mnemosyne, a project-memory system. It finds recent or important memories for the current project or a named project.

In plain words
What is it for?
Use it to retrieve recent memories, important memories, or context for a specific project before starting a task.
Why use it?
It reduces the need to restate earlier decisions and background when continuing work on a project.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is rand/mnemosyne's own configuration. It tells Claude Code how to work on mnemosyne itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mnemosyne configures →

Reuse

Borrowing it

Nothing to install: this file belongs to rand/mnemosyne. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/rand/mnemosyne/main/.claude/commands/memory-context.md
Clone the repo
git clone --depth 1 https://github.com/rand/mnemosyne

Made for: Claude Code.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/rand/mnemosyne/memory-context"><img src="https://agentmods.dev/badge/commands/rand/mnemosyne/memory-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 711 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.00009 $0.00711
Opus 5.5 $0.00004 $0.00284
Sonnet 5.5 $0.00002 $0.00142
Haiku 4.5 $0.00001 $0.00071

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

Security

Grade A, and why

memory-context 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 1mo 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.

.claude/commands/memory-context.md · 102 lines

What it actually says

I will load and display relevant project context from Mnemosyne to help orient you to the current project state.

Usage:

  • /memory-context - Load context for current project
  • /memory-context <project-name> - Load context for specific project
  • /memory-context --recent <days> - Only recent memories
  • /memory-context --important - Only high-importance memories (8+)

Instructions for me:

  1. Parse the arguments:

    • Extract <project-name> if provided as positional arg
    • Extract --recent <days> flag if present
    • Extract --important flag if present
  2. Determine namespace:

    • If <project-name> provided: use project:<project-name>
    • Otherwise auto-detect from git root + CLAUDE.md
    • Use Bash: git rev-parse --show-toplevel 2>/dev/null
    • Parse CLAUDE.md for project name
    • If no project: use global
  3. Fetch recent and important memories: Call mnemosyne.list to get:

    • Recent memories (last 7 days or --recent days)
    • High-importance memories (importance >= 8 or --important)
    {
      "name": "mnemosyne.list",
      "arguments": {
        "namespace": "<namespace>",
        "limit": 50,
        "sort_by": "recent"
      }
    }
    
  4. Build memory graph (optional, for connected decisions): If there are high-importance memories, call mnemosyne.graph to see relationships:

    {
      "name": "mnemosyne.graph",
      "arguments": {
        "seed_ids": [<top 5 important memory IDs>],
        "max_hops": 2
      }
    }
    
  5. Format the output:

    📚 Loading context for project: <project_name>
    
    ## Recent Activity (last <N> days):
    - <date>: <summary>
    - <date>: <summary>
    ...
    
    ## Critical Decisions (importance 8+):
    - <summary> (<type>)
    - <summary> (<type>)
    ...
    
    ## Active Constraints:
    - <constraint content>
    - <constraint content>
    ...
    
    ## Key Patterns:
    - <code_pattern summary>
    - <code_pattern summary>
    ...
    
    ## Related Files (most mentioned):
    - <file_path>
    - <file_path>
    ...
    
    ## Memory Statistics:
    - Total memories: <count>
    - High importance (8+): <count>
    - Recent (7 days): <count>
    - Most connected: "<summary>" (<link_count> links)
    
    ---
    Use /memory-search <query> to find specific information
    Use /memory-list to browse all memories
    
  6. Error handling:

    • If MCP server not available: "Error: Mnemosyne MCP server not running"
    • If no memories found: "No memories found for project: . Start storing with /memory-store"
    • If project not detected: "No project detected. Showing global memories."

Please load and display the project context.

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. 1mo ago First seen · 102 lines · 9 tokens per session scan A 07caddd7e285

Subscribe to this mod's changes

memory-context is a command published in the GitHub repository rand/mnemosyne (101 stars, last pushed 11mo ago), licensed MIT. It adds 9 tokens to every session and 711 once invoked, about $0.0000 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.