Searches the project's recorded memory (core-memory-kit) — decisions, conventions, architecture, the reasoning behind choices, and where things live — and returns a curated, cited summary. Fire whenever the answer might be something the project already established in past work, HOWEVER the question is phrased — any prior decision, convention, rationale, or "how/where/why is it this way" question, including oblique or roundabout asks ("why is everything so spread out?", "remind me what we sett...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add LH8PPL/core-memory-kit --skill memory-search --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Memory Search?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/lh8ppl-memory-search-core-memory-kit)More formats (shields.io, HTML) on the badges page.
---
name: memory-search
description: >-
Searches the project's recorded memory (core-memory-kit) — decisions,
conventions, architecture, the reasoning behind choices, and where things live
— and returns a curated, cited summary. Fire whenever the answer might be
something the project already established in past work, HOWEVER the question is
phrased — any prior decision, convention, rationale, or "how/where/why is it
this way" question, including oblique or roundabout asks ("why is everything so
spread out?", "remind me what we settled on for X", "how come these files are
tiny?"). Also fire when a "[core-memory-kit] Memory available" hint appears on
the prompt. The examples are illustrative, not a checklist — prefer recalling
over re-deriving an answer from the code. The session-start snapshot is a
bounded index; this skill reaches the rest. Skip only when the question is
purely about uncommitted or just-edited live code that memory cannot know,
concerns this conversation only, or the user asked to ignore memory.
context: fork
allowed-tools: mcp__cmk__mk_search mcp__cmk__mk_get mcp__cmk__mk_timeline mcp__cmk__mk_expand mcp__cmk__mk_links mcp__cmk__mk_recent_activity Bash(cmk search *) Bash(cmk get *) Bash(cmk timeline *) Bash(cmk expand *) Bash(cmk links *) Bash(cmk recent-activity *)
---
# Recalling from deep memory
You are a memory-retrieval agent. Search the kit's memory archive for: $ARGUMENTS
Query well: search the core noun phrases (e.g. "deploy target", "auth
library decision"), not a full sentence. If the line above carries NO query
(you run isolated and cannot see the conversation), start from the
"When the query is vague" section below instead.
Memory is the ground truth for documented knowledge and prior decisions
(the injected-snapshot authority rule). Your job is to find what is already
recorded and return ONLY a curated summary — never the raw dumps.
## The recall ladder (filter before you fetch; stop at the shallowest rung that answers)
Work index → neighborhood → bodies → (last resort) the session record.
Full bodies are ~10x the tokens of an index line; fetch them only for the
ids that survived filtering. **Stop climbing the moment a rung answers the
question** — most questions end at step 1 or 2.
**Step 1 — Search the index.** Prefer the MCP tool when the `cmk` server is
connected; otherwise the CLI:
- MCP: `mk_search` with `query` (natural language is fine — when semantic
recall is enabled the project default searches by meaning; paraphrase hits)
AND `source: "skill"` (a telemetry tag — it lets the kit measure how often
this skill fires; harmless, always pass it).
- CLI: `cmk search "<query>" --source skill`
Each hit is one line: id, tier/trust, source location, snippet. Run 1-3
query variants if the first misses (synonyms; the key noun alone). Drop
hits that are clearly off-topic or too generic.
**Score the survivors before you fetch.** After dropping off-topic hits,
rate each remaining hit 1-3 for how directly it answers the question (3 =
likely answers it, 1 = tangential). Fetch full bodies (step 3) ONLY when at
least 2 hits survive at score ≥ 2 — a lone weak hit rarely repays the tokens;
answer from the index line + a re-query instead. This is the policy-retriever
discipline: filter hard, fetch little.
**Relative-answer re-query.** If the question is relative — "the same X as
Sarah", "like the auth project", "whatever we used last time" — a single
search often can't resolve it. Re-query the REFERENT first (search "Sarah"
/ "auth project" to find X), THEN search X for the actual answer. Two cheap
searches beat one that can't land.
**Step 2 — Expand the hit's neighborhood (the middle rung).** A hit returns
the matched chunk; "what did we decide and why" often lives in the lines
AROUND it. Expand returns the hit's enclosing heading section from its
source file — sibling bullets, the surrounding day-file entry — bounded,
never the whole file. Works on BOTH hit-id shapes (`P-XXXXXXXX` and
`T:<file>:<line>`):
- MCP: `mk_expand` with `id: "<hit id>"`.
- CLI: `cmk expand <hit-id>`
Prefer expand over jumping straight to the transcript drill — it answers
"what surrounds this hit" at a fraction of the tokens.
**Step 2b — Context across time (optional, a different axis).** When you
need what happened AROUND a fact chronologically (what led to a decision,
what followed a fix) rather than what sits around it in its file:
- MCP: `mk_timeline` with `anchor: "<id>"` (and `depth_before`/`depth_after`).
- CLI: `cmk timeline <id>`
**Step 2c — Follow the relations (optional, the relational axis).** When the
question is "what points AT this fact" (backlinks — other facts that
reference it, not a similarity question) or "what replaced what, in order"
(the supersession chain), traverse the links graph instead of searching:
- MCP: `mk_links` with `id: "<id>"` (and `direction: "in"|"out"|"both"`, `depth`).
- CLI: `cmk links <id> [--direction in|out] [--depth N]`
This is the fourth adjacency axis beside expand (file), timeline (time), and
the decisions scope (evolution). A superseded fact's label names its
successor (`[superseded by P-XXXX]`) — follow it to the current version.
**Step 3 — Fetch full bodies for the survivors only.**
- MCP: `mk_get` with `ids: [...]` — batch all survivors in ONE call.
- CLI: `cmk get <id> <id> ...`
Rich facts carry **Why** / **How to apply** blocks — include those when the
question is about rationale or how to act on a rule.
**Episodic grouping — when several survivors share the same `source_file`**
(the source-location column of their index lines), they came from ONE episode
(a session, a day-file entry). Do a single `cmk expand` / `mk_expand` on one of
them instead of N separate `mk_get` bodies — expand returns their shared
enclosing section once, restoring the narrative the flat hits fragmented, at a
fraction of the tokens.
**Step 4 — LAST RESORT: the session record.** Only when curated memory
(steps 1-3) has no answer and the question is about what actually happened
in a past session (an exact error message, the command that fixed
something, how a discussion went). This scope covers the verbatim
transcripts AND the compressed session summaries:
- MCP: `mk_search` with `scope: "transcripts"`.
- CLI: `cmk search "<query>" --scope transcripts`
Hits are raw turn excerpts (dialogue + the tools the agent ran), keyed
`T:<file>:<line>` — quote the relevant fragment in your summary; never dump
whole turns. If something found here is durably useful, say so in the
summary so the caller can capture it as a proper fact.
## Decision HISTORY — the `decisions` scope
For "what did we DECIDE about X" a normal fact search (steps 1-3) is enough —
the decision fact carries its own **Why**. But when the question is about how a
decision **evolved**, what we **reject**ed or moved away from, or **why X
changed** ("did we ever consider Y?", "weren't we using Postgres?", "what did
we decide and did it change?"), search the **decision journal** — the
append-only `context/DECISIONS.md`, which keeps superseded + retracted entries
the live fact store no longer carries:
- MCP: `mk_search` with `scope: "decisions"`.
- CLI: `cmk search "<topic>" --scope decisions`
Hits are decision entries keyed by their fact id, labelled `decision` (or
`decision (retracted)` for a reversed one). The retracted/superseded entries
ARE the answer to "what did we reject" — surface them explicitly, with the
date, so the caller sees the trail. Use this scope IN ADDITION to the fact
ladder when the question has a history/evolution axis; the fact search answers
the "current decision", the journal answers "how it got there".
## When the query is vague
If you cannot form a concrete query, look at recent activity first, then
search the topic that stands out:
- MCP: `mk_recent_activity` (window `7d`) · CLI: `cmk recent-activity --window 7d`
## Output
Return a short, curated answer for the main conversation:
- The relevant facts/decisions, each with its citation id (e.g. `P-XXXXXXXX`)
and the Why when it matters.
- **Cite the WHEN and the WHERE:** every hit carries a `date` and a
`heading`/source — say "decided 2026-06-20" and name the source file, so
the caller can judge freshness and drill in. An undated hit (a
consolidated summary) — cite the section's own date heading instead.
- One line of source traceability per item (the source file the index line
showed).
- If nothing relevant exists, say exactly that — "no recorded memory on
this" — so the caller knows to derive it fresh and capture it afterward.
Never paste full fact files or long bodies into the summary; condense.
This skill is read-only — capturing new facts is the `memory-write` skill's
job.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!