memory-search

memory-search is a command for Claude Code from rjmurillo/ai-agents. It costs 24 tokens per session (414 once invoked), scanned A, original, MIT.

A command for searching Forgetful, a knowledge base that stores project memories, by meaning rather than exact words.

In plain words
What is it for?
Use it to retrieve project knowledge, check whether a specific memory exists, filter results to a project, and identify when a search needs refinement.
Why use it?
It helps find relevant past decisions or information when you do not remember the exact wording, and shows linked memories when available.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is **Interface Selection**: This is the CLI interface. See [Memory Interface Decision Matrix](../../../CLAUDE.md#memory-interface-decision-matrix) for when to use .

Good fit Use it to retrieve project knowledge, check whether a specific memory exists, filter results to a project, and identify when a search needs refinement.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/rjmurillo/ai-agents
agentmods
npx agentmods add commands/rjmurillo/ai-agents/memory-search

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-search

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/rjmurillo/ai-agents/memory-search"><img src="https://agentmods.dev/badge/commands/rjmurillo/ai-agents/memory-search.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 414 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.00024 $0.00414
Opus 5.5 $0.00010 $0.00166
Sonnet 5.5 $0.00005 $0.00083
Haiku 4.5 $0.00002 $0.00041

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

Security

Grade A, and why

memory-search 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 2mo 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/forgetful/memory-search.md · 67 lines

What it actually says

Interface Selection: This is the CLI interface. See Memory Interface Decision Matrix for when to use other interfaces.

Search the Forgetful knowledge base for relevant memories.

Your Task

Perform a semantic search using execute_forgetful_tool("query_memory", {...}) with the user's query.

Query: $ARGUMENTS

Search Parameters

Use these parameters for the search:

{
  "query": "<user's search query>",
  "query_context": "User initiated search via /memory-search command",
  "k": 5,
  "include_links": true,
  "max_links_per_primary": 3
}

If the query mentions a specific project, add project_ids filter.

Response Format

Present results clearly:

  1. Summary: Brief overview of what was found (or "No relevant memories found")
  2. Primary Memories: For each memory show:
    • Title (with importance score)
    • Key content snippet
    • Tags
    • Linked memories if relevant
  3. Suggestions: If results seem incomplete, suggest refining the query or creating a new memory

Example

User: /memory-search authentication patterns

You search and respond:

Found 3 memories about authentication patterns:

1. **FastAPI JWT Authentication** (Importance: 9)
   JWT middleware using httponly cookies for security...
   Tags: security, authentication, fastapi

2. **OAuth2 Decision** (Importance: 8)
   Chose OAuth2 over API keys for user-facing auth...
   Tags: decision, oauth, security

Related: Memory #45 (Session management approach)
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. 2mo ago First seen · 67 lines · 24 tokens per session scan A d8b7ca81979c

Subscribe to this mod's changes

memory-search is a command published in the GitHub repository rjmurillo/ai-agents (49 stars, last pushed today), licensed MIT. It adds 24 tokens to every session and 414 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.