memory

memory is a command for Claude Code from a2z2k26/semantic-memory-mcp. It costs 9 tokens per session (900 once invoked), scanned A, original, MIT.

A command interface for storing, retrieving, searching, and coordinating information in a shared semantic memory system. Semantic search finds related meaning, not just exact words.

In plain words
What is it for?
Use it to save or find memories, inspect memory health and statistics, coordinate team status, create handoffs, and record decisions.
Why use it?
It lets agents and teams retain useful decisions, context, and handoffs across work sessions instead of relying only on the current conversation.

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/a2z2k26/semantic-memory-mcp/memory
Clone the repo
git clone --depth 1 https://github.com/a2z2k26/semantic-memory-mcp

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 900 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.00900
Opus 5 $0.00005 $0.00450
Sonnet 5 $0.00002 $0.00180
Haiku 4.5 $0.00001 $0.00090

Measured 3d ago against content hash c17a048b08f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory 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 3d 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.md · 99 lines

How it starts

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

Semantic Memory Command

Execute memory operations against the shared Semantic Memory MCP server.

Available Actions

Core Memory Operations

  • store - Store a memory entry: /memory store mykey '{"data": "value"}'
  • retrieve - Get a memory by key: /memory retrieve mykey
  • search - Search memories: /memory search "search query"
  • list - List recent memories: /memory list
  • stats - Get storage statistics: /memory stats
  • health - Check system health: /memory health

Team Coordination

  • team - Show team status and context: /memory team
  • handoff - Create work handoff for another agent: /memory handoff task-name
  • decide - Record a decision with rationale: /memory decide "Use SQLite" "Better concurrency"

Sandbox Integration

  • sync - Check Memory Bridge status for E2B sandboxes: /memory sync
  • sandboxes - List sandbox memories: /memory sandboxes

Usage Examples

/memory store user:preferences '{"theme": "dark", "lang": "en"}'
/memory retrieve user:preferences
/memory search "API configuration"
/memory list
/memory stats
/memory health
/memory team
/memory handoff feature-implementation
/memory decide "Use FTS5 for search" "Best balance of simplicity and performance"
/memory sync
/memory sandboxes

When to Use Memory

  1. Store important findings - When you discover something that future agents or sessions should know
  2. Record decisions - Document architectural decisions, design choices, rationale
  3. Share context - Pass information between different Claude sessions/worktrees
  4. Track artifacts - Store code snippets, configurations, outputs for reference
  5. Create handoffs - When passing incomplete work to another agent
  6. Check sandbox results - Access work from E2B sandbox agents

Action: $ARGUMENTS.action

Key: $ARGUMENTS.key Value: $ARGUMENTS.value Query: $ARGUMENTS.query Decision: $ARGUMENTS.decision Rationale: $ARGUMENTS.rationale

Based on the action requested, use the appropriate MCP tool:

  • For store: Use memory_store with the key and parsed JSON value
  • For retrieve: Use memory_retrieve with the key
  • For search: Use memory_search with the query
  • For list: Use memory_list
  • For stats: Use memory_stats
  • For health: Use system_health
  • For team: Use team_get_status
  • For handoff: Use team_store_context with key handoff:{key} containing:
    • status: 'in_progress'
    • handoffAt: current timestamp
    • description: Ask user what to include
    • completed: List of completed items
    • remaining: List of remaining items
    • notes: Any relevant context
  • For decide: Use team_record_decision with:
    • decision: The decision text
    • rationale: The rationale provided
    • agentId: Current agent identifier
  • For sync: Check Memory Bridge server at http://127.0.0.1:3847/status Report whether bridge is running and show active sandboxes
  • For sandboxes: Use memory_search with query "sandbox:*" List all memories from E2B sandboxes

Read the full file on GitHub · 99 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. 3d ago First seen · 99 lines · 9 tokens per session scan A c17a048b08f9

Subscribe to this mod's changes

memory is a command published in the GitHub repository a2z2k26/semantic-memory-mcp (2 stars, last pushed 2mo ago), licensed MIT. It adds 9 tokens to every session and 900 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-31.