memory-context

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

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 commands/rand/mnemosyne/memory-context
Clone the repo
git clone --depth 1 https://github.com/rand/mnemosyne

Made for: Claude Code.

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. 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 $0.00009 $0.00711
Opus 5 $0.00005 $0.00356
Sonnet 5 $0.00002 $0.00142
Haiku 4.5 $0.00001 $0.00071

Measured 2d ago against content hash 07caddd7e285, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

.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. 2d 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 (84 stars, last pushed 9mo ago), licensed MIT. It adds 9 tokens to every session and 711 once invoked, about $0.0000 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.

Related

Other commands, from other repositories