Skip to content
duckdb avatar

Read Memories

Search past Claude Code session logs by keyword to recover prior decisions, patterns, and open work.

CCM score
68 of 100
skills.sh installs
934
GitHub stars
623
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers querying session logs under $HOME/.claude/projects with DuckDB, returning up to 40 matching messages
  • Includes a --here option that scopes the search to the current project directory only
  • Returns the project, timestamp, role, and first 500 characters of each matching message, ordered by time
  • Designed for picking up context when the user refers to earlier conversations or unresolved decisions

Install

$ npx -y skills add duckdb/duckdb-skills --skill read-memories -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

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.

Details

Repository
github.com/duckdb/duckdb-skills
Categories
Memory & Context, Agent Workflow & Planning
First seen
Jun 3, 2026

Questions

What does the read-memories skill do?

The read-memories skill searches past Claude Code session logs to recall prior decisions, patterns, and unresolved work. It runs a DuckDB query over the saved session files and absorbs the results to enrich the current response, without repeating raw logs to the user.

How do I install the read-memories skill?

Run npx -y skills add duckdb/duckdb-skills --skill read-memories -y in your project. Once installed, the agent can search earlier sessions when you ask things like do you remember or what did we do.

Does read-memories search only the current project?

By default it searches all projects under the Claude projects folder. Passing the --here flag as the second argument scopes the search to the current project only.

Which skills are in the same category as read-memories?

read-memories sits in the Memory and Context category, alongside handoff and several caveman skills such as caveman-compress and caveman-learn. It stands out by querying DuckDB directly over saved session logs.

What does read-memories need to run?

It needs the DuckDB CLI installed, and it reads session logs stored under the home directory's .claude/projects folder. It uses the Bash tool to run its queries.

More from duckdb/duckdb-skills

All 6

Similar to Read Memories

More Memory & Context