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.
curl -O https://raw.githubusercontent.com/rand/mnemosyne/main/.claude/commands/memory-consolidate.mdgit clone --depth 1 https://github.com/rand/mnemosyneWrote 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.
[](https://agentmods.dev/commands/rand/mnemosyne/memory-consolidate)<a href="https://agentmods.dev/commands/rand/mnemosyne/memory-consolidate"><img src="https://agentmods.dev/badge/commands/rand/mnemosyne/memory-consolidate/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.
<a href="https://agentmods.dev/commands/rand/mnemosyne/memory-consolidate"><img src="https://agentmods.dev/badge/commands/rand/mnemosyne/memory-consolidate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00012 | $0.01240 |
| Opus 5.5 | $0.00005 | $0.00496 |
| Sonnet 5.5 | $0.00002 | $0.00248 |
| Haiku 4.5 | $0.00001 | $0.00124 |
Grade A, and why
memory-consolidate 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.
How it starts
The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
I will help you consolidate similar or duplicate memories to keep your knowledge base clean and organized.
Usage:
/memory-consolidate- Find and review consolidation candidates/memory-consolidate --auto- Auto-apply all recommendations/memory-consolidate <id1> <id2>- Analyze specific pair/memory-consolidate --namespace <ns>- Limit to namespace
Instructions for me:
-
Parse the arguments:
- Extract
--autoflag if present (auto-apply mode) - Extract
--namespaceflag if present (otherwise auto-detect) - Extract two memory IDs if provided as positional args
- If both
--autoand IDs provided: error
- Extract
-
Auto-detect namespace (if not specified):
- Use Bash:
git rev-parse --show-toplevel 2>/dev/null - Read CLAUDE.md for project name
- Construct namespace as
project:<name> - If no project: use
null(all)
- Use Bash:
-
Mode A: Specific pair analysis (if two IDs provided):
- Call
mnemosyne.consolidatewith the two IDs:
{ "name": "mnemosyne.consolidate", "arguments": { "memory_ids": ["<id1>", "<id2>"], "auto_apply": false } }- Display the recommendation:
Analyzing consolidation of two memories: Memory A [<importance>/10]: <summary> Created: <date> <content preview (200 chars)> Memory B [<importance>/10]: <summary> Created: <date> <content preview (200 chars)> --- LLM Recommendation: <MERGE|SUPERSEDE|KEEP_BOTH> <if MERGE>: Reason: Memories contain very similar information Action: Merge into Memory <A|B> (higher importance), archive the other New content will combine both perspectives <if SUPERSEDE>: Reason: Memory <A|B> contains updated/more accurate information Action: Keep Memory <kept>, mark Memory <superseded> as superseded <if KEEP_BOTH>: Reason: Memories are distinct and should be maintained separately Action: No consolidation needed --- Apply this recommendation? [y/N]: (Or run with /memory-consolidate --auto <id1> <id2> to apply automatically) - Call
-
Mode B: Find candidates (default mode):
- Call
mnemosyne.consolidatewithout IDs:
{ "name": "mnemosyne.consolidate", "arguments": { "namespace": "<namespace or null>", "auto_apply": <--auto flag value> } }- If candidates found, display each:
🔍 Scanning for consolidation candidates in <namespace>... Found <N> candidate pairs: <for each pair>: <number>. <MERGE|SUPERSEDE|KEEP_BOTH> Recommended Memory A [<imp>/10]: "<summary>" Created: <date>, Tags: <tags> Memory B [<imp>/10]: "<summary>" Created: <date>, Tags: <tags> Similarity: <high|medium|low> Reason: <LLM reasoning> <if --auto>: ✓ Applied: <action taken> <if not --auto>: [View details: /memory-consolidate <idA> <idB>] ---- Summary at end:
Summary: - Total pairs analyzed: <N> - Merge recommended: <N> - Supersede recommended: <N> - Keep both: <N> <if --auto>: - Actions applied: <N> - Memories archived: <N> <if not --auto>: To apply recommendations: - Review each pair: /memory-consolidate <id1> <id2> - Auto-apply all: /memory-consolidate --auto - Call
-
Interactive confirmation (if not --auto):
- After showing recommendation for a specific pair
- Ask user: "Apply this recommendation? [y/N]: "
- If 'y': Call consolidate again with
auto_apply: true - If 'N' or anything else: Do nothing, exit
-
Format the detailed pair view: When showing specific pair details, include:
- Full content (not just preview)
- All tags and keywords
- Related files and entities
- Link information
- Access statistics
-
Error handling:
- If MCP server not available: "Error: Mnemosyne MCP server not running"
- If API key not configured: "Error: Consolidation requires LLM. Configure API key with 'mnemosyne config set-key'"
- If invalid memory IDs: "Error: Invalid memory ID(s). Use /memory-list to see available memories"
- If no candidates found: "No consolidation candidates found. Your memory base is well-organized!"
- If both --auto and IDs provided: "Error: Cannot use --auto with specific memory IDs"
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.
- 1mo ago First seen · 160 lines · 12 tokens per session scan A 42344c8202d9
memory-consolidate is a command published in the GitHub repository rand/mnemosyne (101 stars, last pushed 11mo ago), licensed MIT. It adds 12 tokens to every session and 1,240 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.
Other commands, from other repositories
diagnose-synapse
Run a comprehensive diagnostic of the SYNAPSE context engine, comparing expected vs. actual pipeline state, including session performance analysis with exact timing data.
memory
Read-side memory operations on the knowledge graph: search past decisions and patterns, load session context, view decision timelines, render Mermaid graph visualizations. Subcommands: search, load, history, viz, status. Use when finding or reviewing what memory already holds. For storing new knowledge instead, invoke…
compact-prep
Ask the agent to prepare for conversation compaction by updating any relevant state and providing guidance for the compaction agent and to kick off the session there after.
greet
Generate contextual agent greeting using GreetingBuilder infrastructure.
add-rule
Adds a new rule to an existing SYNAPSE domain file.
toggle-domain
Toggles a SYNAPSE domain between active and inactive in the manifest.