memory-search

A single search command for finding information across several long-term memory stores, including notes, code indexes, session summaries, saved rules, and recordings. A code index is a searchable catalogue of code symbols and sections.

In plain words
What is it for?
Use it to answer questions such as why a technical choice was made, find functions or classes, or recover relevant information from earlier work.
Why use it?
It removes the need to know which storage system contains a past decision, code detail, or lesson.

Command

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/adilkalam/orca/memory-search
Clone the repo
git clone --depth 1 https://github.com/adilkalam/orca
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 878 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.00026 $0.00878
Opus 5 $0.00013 $0.00439
Sonnet 5 $0.00005 $0.00176
Haiku 4.5 $0.00003 $0.00088

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

commands/memory-search.md · 123 lines

How it starts

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

Search across all memory systems in one command.

Command: /memory-search $ARGUMENTS

What It Searches (federated)

The unified script federates across every durable memory store, so a "why did we choose X" answer surfaces regardless of which store it lives in:

  1. Workshop (decisions, notes, gotchas, learnings) -- via the workshop CLI
  2. code-index.db (code chunks, symbols, functions, classes)
  3. Cognition harvests (.orca/cognition/** -- cognition session summaries)
  4. Claude auto-memory (~/.claude/projects/<slug>/memory/MEMORY.md + linked files)
  5. CLAUDE.md Learned Rules ledger
  6. orca-record checkpoints (prompt summaries from .orca/recording.db)
  7. Research Index (optional, if the project has a research-sync script)

Execution

Step 1: Parse Query

Extract the search query from arguments. If empty, show help.

Step 2: Federated search (primary)

The unified script covers Workshop + code-index.db + cognition + auto-memory + Learned Rules + recording in one call:

python3 ~/.claude/scripts/memory-search-unified.py "$QUERY" --mode all --top-k 10 2>/dev/null \
  || echo "unified search unavailable"

Step 4: Search Research Index (if exists)

If the project has a research-sync script (e.g., .claude/scripts/research-sync.py), also search research chunks:

# Only run if research-sync script exists in the project
if [ -f .claude/scripts/research-sync.py ]; then
  python3 .claude/scripts/research-sync.py search "$QUERY" --limit 10 2>/dev/null || true
fi

Step 5: Present Unified Results

Format the output clearly:

Memory Search: "<query>"

=== WORKSHOP (Decisions/Notes) ===

[Results from workshop search, or "No matches found"]

=== CODE (code-index.db) ===

[Results from code-index hsearch, formatted as:]

| Type     | Name              | File                          | Score |
|----------|-------------------|-------------------------------|-------|
| function | handleAuth        | src/auth/jwt.ts:45            | 0.85  |
| class    | AuthService       | src/services/auth.ts:12       | 0.72  |

[Or "No matches found" / "Run /project-code sync first"]

=== RESEARCH (if indexed) ===

[Results from research-sync search, formatted as:]

| Type        | Title                              | Section              | Score |
|-------------|------------------------------------|--------------------- |-------|
| source_note | Sara Roy: If Israel Were Smart    | The WikiLeaks Cable  | 0.85  |
| reflection  | LLM Reflection V6                  | The Apparatus        | 0.72  |

[Or skip section if research-sync.py doesn't exist]

Read the full file on GitHub · 123 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. 2d ago First seen · 123 lines · 26 tokens per session scan A 12d525ec1010

Subscribe to this mod's changes

memory-search is a command published in the GitHub repository adilkalam/orca (2 stars, last pushed 1mo ago), licensed MIT. It adds 26 tokens to every session and 878 once invoked, about $0.0001 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.