How this skill is triggered — by the user, by Claude, or both
Slash command
/session-search:session-searchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Search across all Claude Code session history in `~/.claude/projects/` using grep-based agentic search.
Search across all Claude Code session history in ~/.claude/projects/ using grep-based agentic search.
Prerequisite: Python 3 (pre-installed on macOS and major Linux distros).
Each session file is a JSONL where each line is a JSON object. User messages look like:
{"type":"user","message":{"role":"user","content":"search query here"},"uuid":"...","timestamp":"2025-02-14T10:30:00.000Z",...}
Key fields:
type: "user" for user messages, "assistant" for responsesmessage.content: string, or array of {"type":"text","text":"..."} objectstimestamp: ISO 8601 formattype: "queue-operation" indicates a subagent session (skip these)$ARGUMENTS is required. If empty, print usage and stop:
Usage: /session-search <query>
Example: /session-search "Slack API integration"
Example: /session-search "N+1 query optimization"
Extract the search query. Remove surrounding quotes if present.
Interpret the user's query and generate 3-5 search keywords.
Print the keywords:
Searching with: [keyword1, keyword2, keyword3, ...]
Use a single grep -Erl with regex OR to find all candidate files in one scan:
grep -Erl 'keyword1|keyword2|keyword3' ~/.claude/projects/*/*.jsonl 2>/dev/null
This is 2-7x faster than running separate grep -Frl per keyword.
Then, use a Python script to score, extract, and format results in one pass. The script should:
"type":"queue-operation").type is "user".message.content is longer than 2000 characters (skill/system prompt expansions).timestamp."assistant" message content (truncated to 200 chars) as context.Process files in score order (highest first). Stop after 5 results.
If zero results, try one more search with alternative/broader keywords.
Output as Markdown directly to the conversation:
## Search Results for: "$ORIGINAL_QUERY"
Keywords: [keyword1, keyword2, ...]
### project-name
**YYYY-MM-DD HH:MM** `session: full-uuid-here`
> matched message content (truncated to 300 chars)...
>
> _context: assistant response excerpt (truncated to 200 chars)..._
### another-project
**YYYY-MM-DD HH:MM** `session: full-uuid-here`
> matched message content...
>
> _context: assistant response excerpt..._
---
Found N results across M projects.
.jsonl) as session ID.YYYY-MM-DD HH:MM in local timezone.npx claudepluginhub suto-michimasa/cc-session-tools --plugin session-searchSearches prior Claude-Code/Codex-CLI sessions for code patterns, decisions, or work via aichat CLI, jq parsing, and session file reads (max 3). For non-subagent CLI agents.
Searches Claude Code conversation history by topic or date filters, returning session IDs and project paths for resumption via 'claude --resume'. For queries like 'find conversation about X' or 'what did we do yesterday'.
Searches and recalls previous Claude Code conversation sessions by querying a local SQLite FTS5 index or JSONL log files.