/recall — Search Past Claude, Codex, pi & Grok Sessions
Search all past Claude Code, Codex, pi and Grok sessions using full-text search with BM25 ranking.
Usage
python3 ~/.claude/skills/recall/scripts/recall.py [QUERY] [--project PATH] [--days N] [--source claude|codex|pi|grok] [--limit N] [--reindex]
Examples
# List every session in the last day (no text search)
python3 ~/.claude/skills/recall/scripts/recall.py --days 1
# List every pi session in the last week
python3 ~/.claude/skills/recall/scripts/recall.py --days 7 --source pi
# Simple keyword search
python3 ~/.claude/skills/recall/scripts/recall.py "bufferStore"
# Phrase search (exact match)
python3 ~/.claude/skills/recall/scripts/recall.py '"ACP protocol"'
# Boolean query
python3 ~/.claude/skills/recall/scripts/recall.py "rust AND async"
# Prefix search
python3 ~/.claude/skills/recall/scripts/recall.py "buffer*"
# Filter by project and recency
python3 ~/.claude/skills/recall/scripts/recall.py "state machine" --project ~/my-project --days 7
# Search only Claude Code sessions
python3 ~/.claude/skills/recall/scripts/recall.py "buffer" --source claude
# Search only Codex sessions
python3 ~/.claude/skills/recall/scripts/recall.py "buffer" --source codex
# Search only pi sessions
python3 ~/.claude/skills/recall/scripts/recall.py "buffer" --source pi
# Search only Grok sessions
python3 ~/.claude/skills/recall/scripts/recall.py "buffer" --source grok
# Force reindex
python3 ~/.claude/skills/recall/scripts/recall.py --reindex "test"
Query Syntax (FTS5)
- Words:
bufferStore — matches stemmed variants (e.g., "discussing" matches "discuss")
- Phrases:
"ACP protocol" — exact phrase match
- Boolean:
rust AND async, tauri OR electron, NOT deprecated
- Prefix:
buffer* — matches bufferStore, bufferMap, etc.
- Combined:
"state machine" AND test
- CJK:
issue化 — automatically uses trigram matching for Japanese/Chinese/Korean text
After Finding a Match
To resume a session, cd into the project directory and use the appropriate command:
# Claude Code sessions [claude]
cd /path/to/project
claude --resume SESSION_ID
# Codex sessions [codex]
cd /path/to/project
codex resume SESSION_ID
# Grok sessions [grok]
```bash
grok --resume SESSION_ID
Pi sessions [pi]
cd /path/to/project
pi --session SESSION_ID # full or partial id; pi resolves prefix matches
Each result includes a `File:` path. Use it to read the raw transcript (auto-detects format):
```bash
python3 ~/.claude/skills/recall/scripts/read_session.py <File-path-from-result>
If results are missing File: paths, run --reindex to backfill.
Notes
- Index is stored at
~/.recall.db (SQLite FTS5, auto-migrated from ~/.claude/recall.db)
- Indexes four sources:
~/.claude/projects/ (Claude Code), ~/.codex/sessions/ (Codex), ~/.pi/agent/sessions/ (pi), and ~/.grok/sessions/**/chat_history.jsonl (Grok)
- First run indexes all sessions (a few seconds); subsequent runs are incremental
- Only user and assistant messages are indexed (tool calls, thinking blocks, state snapshots skipped)
- Results show
[claude], [codex], [pi], or [grok] tags to indicate the source
- Dual-table FTS: English queries use Porter stemming, CJK queries use trigram matching
- Omit the query argument for list mode — every session in the window, sorted by recency, no FTS
- Provide a query for full-text search; both modes accept
--project, --days, --source, --limit
- Upgrading from 0.3.x: run
--reindex once to pull in pi sessions
- Upgrading from 0.4.x: run
--reindex once to pull in Grok sessions
- Upgrading from 0.2.x: run
--reindex once to build the CJK index
1---2name: recall3description: Search past Claude Code, Codex, pi and Grok sessions. Triggers: /recall, "search old conversations", "find a past session", "recall a previous conversation", "search session history", "what did we discuss", "remember when we"4---5
6# /recall — Search Past Claude, Codex, pi & Grok Sessions
7
8Search all past Claude Code, Codex, pi and Grok sessions using full-text search with BM25 ranking.
9
10## Usage
11
12```bash
13python3 ~/.claude/skills/recall/scripts/recall.py [QUERY] [--project PATH] [--days N] [--source claude|codex|pi|grok] [--limit N] [--reindex]
14```
15
16## Examples
17
18```bash
19# List every session in the last day (no text search)
20python3 ~/.claude/skills/recall/scripts/recall.py --days 1
21
22# List every pi session in the last week
23python3 ~/.claude/skills/recall/scripts/recall.py --days 7 --source pi
24
25# Simple keyword search
26python3 ~/.claude/skills/recall/scripts/recall.py "bufferStore"
27
28# Phrase search (exact match)
29python3 ~/.claude/skills/recall/scripts/recall.py '"ACP protocol"'
30
31# Boolean query
32python3 ~/.claude/skills/recall/scripts/recall.py "rust AND async"
33
34# Prefix search
35python3 ~/.claude/skills/recall/scripts/recall.py "buffer*"
36
37# Filter by project and recency
38python3 ~/.claude/skills/recall/scripts/recall.py "state machine" --project ~/my-project --days 7
39
40# Search only Claude Code sessions
41python3 ~/.claude/skills/recall/scripts/recall.py "buffer" --source claude
42
43# Search only Codex sessions
44python3 ~/.claude/skills/recall/scripts/recall.py "buffer" --source codex
45
46# Search only pi sessions
47python3 ~/.claude/skills/recall/scripts/recall.py "buffer" --source pi
48
49# Search only Grok sessions
50python3 ~/.claude/skills/recall/scripts/recall.py "buffer" --source grok
51
52# Force reindex
53python3 ~/.claude/skills/recall/scripts/recall.py --reindex "test"
54```
55
56## Query Syntax (FTS5)
57
58- **Words**: `bufferStore` — matches stemmed variants (e.g., "discussing" matches "discuss")
59- **Phrases**: `"ACP protocol"` — exact phrase match
60- **Boolean**: `rust AND async`, `tauri OR electron`, `NOT deprecated`
61- **Prefix**: `buffer*` — matches bufferStore, bufferMap, etc.
62- **Combined**: `"state machine" AND test`
63- **CJK**: `issue化` — automatically uses trigram matching for Japanese/Chinese/Korean text
64
65## After Finding a Match
66
67To resume a session, `cd` into the project directory and use the appropriate command:
68
69```bash
70# Claude Code sessions [claude]
71cd /path/to/project
72claude --resume SESSION_ID
73
74# Codex sessions [codex]
75cd /path/to/project
76codex resume SESSION_ID
77
78# Grok sessions [grok]
79```bash
80grok --resume SESSION_ID
81```
82
83# Pi sessions [pi]
84cd /path/to/project
85pi --session SESSION_ID # full or partial id; pi resolves prefix matches
86```
87
88Each result includes a `File:` path. Use it to read the raw transcript (auto-detects format):
89
90```bash
91python3 ~/.claude/skills/recall/scripts/read_session.py <File-path-from-result>
92```
93
94If results are missing `File:` paths, run `--reindex` to backfill.
95
96## Notes
97
98- Index is stored at `~/.recall.db` (SQLite FTS5, auto-migrated from `~/.claude/recall.db`)
99- Indexes four sources: `~/.claude/projects/` (Claude Code), `~/.codex/sessions/` (Codex), `~/.pi/agent/sessions/` (pi), and `~/.grok/sessions/**/chat_history.jsonl` (Grok)
100- First run indexes all sessions (a few seconds); subsequent runs are incremental
101- Only user and assistant messages are indexed (tool calls, thinking blocks, state snapshots skipped)
102- Results show `[claude]`, `[codex]`, `[pi]`, or `[grok]` tags to indicate the source
103- Dual-table FTS: English queries use Porter stemming, CJK queries use trigram matching
104- Omit the query argument for **list mode** — every session in the window, sorted by recency, no FTS
105- Provide a query for full-text search; both modes accept `--project`, `--days`, `--source`, `--limit`
106- **Upgrading from 0.3.x**: run `--reindex` once to pull in pi sessions
107- **Upgrading from 0.4.x**: run `--reindex` once to pull in Grok sessions
108- **Upgrading from 0.2.x**: run `--reindex` once to build the CJK index