Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add duckdb/duckdb-skills --skill read-memories -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/read-memories/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/read-memories/

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

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set7

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor