read-memories — Claude Code skill: what it does, how to install
Searches past Claude Code session logs via DuckDB to recall earlier decisions and unresolved tasks. Brings relevant context back without manual file digging.
npx skills add duckdb/duckdb-skills --skill read-memories -a claude-codeWhat read-memories does
The skill executes an in-memory duckdb query via Bash to inspect .jsonl log files from previous sessions. It relies on the read_ndjson function, filtering messages by keyword and returning up to 40 chronological records.
Queries scan either the entire $HOME/.claude/projects/ directory or isolate the active repository when passed --here. The prompt directs the agent to internalize extracted decisions and TODOs quietly instead of dumping raw JSON output to the user.
A working duckdb command-line binary must already exist in your system PATH, because the command directly invokes it in memory.
What it helps with
- recall architectural decisions from past sessions
- find user corrections and patterns discussed earlier
- restrict memory search to the current project
- extract unresolved TODOs from closed session logs
Example prompts for the agent
- Do you remember how we structured database migrations in our last session?
- What did we decide about the auth endpoints? Check past sessions.
- Look up unresolved bugs in the current project logs.
How to install read-memories
1Skills CLI (Vercel)
npx skills add duckdb/duckdb-skills --skill read-memories -a claude-code2Manually: put the files in place
~/.claude/skills/read-memories/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/read-memories/
1Skills CLI (Vercel)
npx skills add duckdb/duckdb-skills --skill read-memories -a codex2Manually: put the files in place
.agents/skills/read-memories/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add duckdb/duckdb-skills --skill read-memories -a cursor2Manually: put the files in place
.cursor/skills/read-memories/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install duckdb/duckdb-skills read-memories2Manually: put the files in place
.github/skills/read-memories/SKILL.md1Skills CLI (Vercel)
npx skills add duckdb/duckdb-skills --skill read-memories -a gemini-cli2Platform CLI
gemini skills install https://github.com/duckdb/duckdb-skills --path skills/read-memoriesManually: put the files in place
.devin/skills/read-memories/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add duckdb/duckdb-skills --skill read-memories -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about read-memories
How do I install read-memories in Claude Code?
Run npx skills add duckdb/duckdb-skills --skill read-memories -a claude-code in your terminal.
What does read-memories do?
It queries Claude Code session logs via DuckDB to retrieve previous decisions, user corrections, and pending tasks.
What prerequisites are required?
The duckdb CLI binary must be installed on your machine and accessible through Bash.
Source text
SKILL.md · MIT
---
name: read-memories
description: >
Search past Claude Code session logs to recall prior decisions, patterns, or unresolved work.
Use when user says "do you remember", "what did we do", references past conversations, or you need context from prior sessions.
argument-hint: <keyword> [--here]
allowed-tools: Bash
---
Search past session logs silently — do NOT narrate the process. Absorb the results and continue with enriched context.
`$0` is the keyword. Pass `--here` as `$1` to scope to the current project only.
## Step 1 — Query
```bash
duckdb :memory: -c "
SELECT
regexp_extract(filename, 'projects/([^/]+)/', 1) AS project,
strftime(timestamp::TIMESTAMPTZ, '%Y-%m-%d %H:%M') AS ts,
message.role AS role,
left(message.content::VARCHAR, 500) AS content
FROM read_ndjson('<SEARCH_PATH>', auto_detect=true, ignore_errors=true, filename=true)
WHERE message::VARCHAR ILIKE '%<KEYWORD>%'
AND message.role IS NOT NULL
ORDER BY timestamp
LIMIT 40;
"
```
Search paths:
- All projects: `$HOME/.claude/projects/*/*.jsonl`
- Current only (`--here`): `$HOME/.claude/projects/$(echo "$PWD" | sed 's|[/_]|-|g')/*.jsonl`
Replace `<SEARCH_PATH>` and `<KEYWORD>` before running.
## Step 2 — Internalize
From the results, extract decisions, patterns, unresolved TODOs, and user corrections. Use this to inform your current response — do not repeat raw logs to the user.
© duckdb · MIT · duckdb/duckdb-skills