Claude-skill-registry automem-search
Search, filter, and retrieve Claude/Codex history indexed by the automem CLI. Use when the user wants to index history, run lexical/semantic/hybrid search, fetch full transcripts, or produce LLM-friendly JSON output for RAG.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/automem-search" ~/.claude/skills/majiayu000-claude-skill-registry-automem-search && rm -rf "$T"
manifest:
skills/data/automem-search/SKILL.mdsource content
Automem Search
Use this skill to index local history and retrieve results in a structured, LLM-friendly way.
Indexing
- Build or update the index (incremental):
./target/debug/automem index
- Full rebuild (clears index):
./target/debug/automem reindex
- Embeddings are on by default.
- Disable embeddings:
./target/debug/automem index --no-embeddings
- Backfill embeddings only:
./target/debug/automem embed
- Common flags:
for Claude logs--source <path>
to include agent transcripts--include-agents
to include or skip Codex logs--codex/--no-codex
to change data root (default:--root <path>
)~/.automem
Search (LLM default JSON)
Run a search; output is JSON lines by default.
./target/debug/automem search "query" --limit 20
Each JSON line includes:
,doc_id
(ISO),ts
,session_id
,project
,rolesource_path
(full record text)text
(trimmed single-line summary)snippet
(offsets + before/after context)matches
(ranked score)score
Mode decision table
| Need | Command |
|---|---|
| Exact terms | |
| Fuzzy concepts | |
| Mixed | |
Filters
--project <name>--role <user|assistant|tool_use|tool_result>--tool <tool_name>
(search inside a transcript)--session <session_id>--source claude|codex
/--since <iso|unix>--until <iso|unix>--limit <n>--min-score <float>
Grouping / dedupe
(top n per session)--top-n-per-session <n>
(same as top‑k per session = 1)--unique-session
(default score)--sort score|ts
Output shape
- JSONL default (one JSON per line)
for a single JSON array--json-array
to reduce output--fields score,ts,doc_id,session_id,snippet
for human output-v/--verbose
Narrow first (fastest reducers)
- Global search with
--limit - Reduce with
and--project--since/--until - Optionally
or--top-n-per-session--unique-session
for full context./target/debug/automem session <id>
Practical narrowing tips
- Start with exact terms (quoted) before hybrid if results are noisy.
- Use
to collapse PR‑link spam fast.--unique-session - Use
to prune low-signal hits.--min-score - Use
when you want a timeline view.--sort ts - Use
for narrative outcomes;--role assistant
for command errors.--role tool_result - For a specific session, prefer
to jump to outcomes.search "<term>" --session <id> --sort ts --limit 50
Config
Create
~/.automem/config.toml (or <root>/config.toml if you use --root):
embeddings = true auto_index_on_search = true
auto_index_on_search runs an incremental index update before each search.
Semantic and Hybrid
- Semantic:
--semantic - Hybrid (BM25 + vectors, RRF):
--hybrid - Recency tuning:
--recency-weight <float>--recency-half-life-days <float>
Fetch Full Context
- One record:
./target/debug/automem show <doc_id>
- Full transcript:
./target/debug/automem session <session_id>
Both commands return JSON by default.
Human Output
Use
-v/--verbose for human-readable output:
./target/debug/automem search "query" -v./target/debug/automem show <doc_id> -v./target/debug/automem session <session_id> -v
Sharing Sessions
Share a session transcript via agentexport (requires
brew install nicosuave/tap/agentexport):
memex share <session_id> memex share <session_id> --title "Bug fix session"
Returns an encrypted share URL like
https://agentexports.com/v/abc123#key.
In the TUI (
memex tui), press S to share the selected session.
Recommended LLM Flow
./target/debug/automem search "query" --limit 20- Pick hits using
ormatchessnippet
or./target/debug/automem show <doc_id>./target/debug/automem session <session_id>- Refine with
,--session
, or time filters--role - Share relevant sessions with
memex share <session_id>