---
name: memory
effort: low
description: |
  Browse and search the project's memory — the front-of-mind index
  (`MEMORY.md`) and the recall corpus behind it (every memory file,
  the per-session records, archived drafts, retained transcripts).
  The human face of the recall index. Use when: "what's in memory",
  "memory", "/memory", "show memories", "search memory", "find a memory
  about X". To answer a question from the record, use /recall; to
  write memory, write it natively (rules/memory-capture.md).
user-invocable: true
---

# /memory — Browse the Memory Index and Corpus

## Mental Model

Three layers (`cabinet/memory-contract.md`):

1. **Front of mind** — `MEMORY.md` in `~/.claude/projects/<slug>/memory/`
   (a worktree shares its main project's dir). Loaded at every session
   start. Standing facts only: preferences, identity, hard constraints,
   what is currently true. One line per fact, pointing at its file.
2. **Recalled on cue** — every other memory file (no index line), the
   per-session records, the archived extraction drafts and the retained
   transcripts, indexed by the recall script and reached by `/recall`.
3. **Live now** — threads + last session, in the session-start injection.

**This skill is the reader.** Writing happens natively, in the session,
at the moment of learning — no capture command (see
`rules/memory-capture.md`). Answering a *question* from the record is
`/recall`'s job: search → read the top few → one cited paragraph.
`/memory` is for looking at what is there.

## Resolving the memory dir

```bash
node -e "console.log(require('./scripts/project-context.cjs').resolveMemoryDir())" 2>/dev/null || \
  echo "$HOME/.claude/projects/$(pwd | sed 's|/|-|g')/memory"
```

## Mode of operation

Parse the user's intent from their prompt.

### Browse (default — no arguments)

1. Read `MEMORY.md` and present the index conversationally: for each
   line, the title and what it covers. It is small on purpose — every
   line is a standing fact. If a line is plainly no longer true, say so;
   the fix is a native edit of that line and its file (the session that
   notices, edits — the contract's rule), never a scripted pass.
2. Report the corpus behind the index from the recall script's `status`:
   ```bash
   node ~/.claude-cabinet/watchtower/scripts/watchtower-recall.mjs status --cwd "$(pwd)"
   ```
   It prints the document count per source (memory files, session
   records, archived drafts, transcripts), the chunk count, the index
   size and the last refresh (`--json` for the raw shape). `no-index`
   means the project is registered but nothing has built its index yet —
   the first `search` (or Ring 1's next tick) builds it. If the script is
   absent in this consumer (not yet upgraded), fall back to `ls` of the
   memory dir and say the recall index is not available in this project.

Don't dump file contents unless asked.

### Search — user provides a topic

Shell the same search `/recall` uses, verbatim query:
```bash
node ~/.claude-cabinet/watchtower/scripts/watchtower-recall.mjs search \
  --cwd "$(pwd)" --query "<topic>" --json
```
Results are the best chunk per file — path, source, title, heading, a
short snippet, a score — interleaved across sources. Present the top
matches by title and source, read the 2–3 most relevant files with the
Read tool and quote the relevant section. If the query spans several
matches, surface 3–5 and ask whether to dig deeper. Never paste the raw
JSON; never present a hit list as the answer to a question — that is
`/recall`, which writes one cited paragraph.

Fallback when the recall script is absent: `grep -i -l "<topic>"` over
the memory dir's `*.md`, then read the hits.

### Remember — user wants to store something

Write it natively, now, in the memory dir — one fact per file with
frontmatter — and add a `MEMORY.md` line ONLY if it is a standing fact
(a preference, an identity fact, a hard constraint, what is currently
true). A lesson, a decision, a how-we-solved-it gets a file and no index
line; `/recall` finds it. Search first and update an existing memory
rather than write a twin. Never write a region pointer; never trim.

The platform's own background consolidation ("auto-dream") merges recent
sessions into the memory folder on its own schedule; `/dream` runs it by
hand. Leave it on (`cabinet/memory-contract.md`). Whether any of this is
reached is measured, not assumed: the retrieval instrument's per-project
line in the state file's Standing Issues (files read, `/recall`
invocations, hit rate — `state/retrieval-instrument.json`).

## Presentation

Keep it conversational. Summarize rather than dumping raw output. For
browse, present the index and the corpus counts. For search, quote the
most relevant matches with their source files.

## Calibration

**Without this skill:** the user has no easy way to see what the index
holds or how big the corpus behind it is, and a topic search means
guessing filenames.

**With this skill:** the index is browsable, the corpus is searchable
through the same retriever `/recall` uses, and a stale standing fact is
noticed and fixed by hand. The system stays legible.
