Skip to content
cc-session-search logo

Session Search

cc-session-search

Search Claude Code conversation history. Use when user asks "where did I discuss X", "when did we talk about X", "find the conversation about X", or wants to continue previous work.

SKILL.md

Full skill instructions

Session Search

Search and analyze Claude Code conversation history.

For storage internals (sessions-index.json, /​rename scope, path encoding): See cc-internals skill.

Quick Reference

FactValue
Sessions location~/​.claude/​projects/<encoded-path>/
Session formatJSONL (one JSON object per line)
Main sessions<uuid>.jsonl
Subagent sessionsagent-<hash>.jsonl

Tool Selection

TaskUse ThisNOT This
Pattern searchCC Grep toolrg via Bash
Read filesCC Read toolcat via Bash
Find filesCC Glob toolfind via Bash
JSON extractionjq via Bash(no CC equivalent)

Why CC tools: Better permissions, structured output, error handling. Why Bash for jq: No native JSONL parsing in CC.

JSONL Message Structure

{
  "type": "user" | "assistant" | "summary",
  "timestamp": "<ISO-8601>",
  "message": { "content": [{ "type": "text", "text": "..." }] },
  "uuid": "<uuid>",
  "sessionId": "<uuid>"
}

Search Approach

Step 1: Use CC Grep tool to find matching sessions

Grep pattern="X" path="~/​.claude/​projects/" output_mode="files_with_matches"

Step 2: Use Bash + jq for JSON extraction

jq -c 'select(.type=="user") | select(.message.content[].text | test("pattern";"i"))' file.jsonl

Step 3: Use CC Read tool to examine specific session content

Query Workflows

"Where did I discuss X?"

  1. Grep tool → find matching session files
  2. Decode paths to project names
  3. Bash + jq → extract first timestamp + context
  4. Report: project, session ID, date range, snippet

"When did we discuss X?"

  1. Grep tool → find matching files
  2. Bash + jq → extract timestamps from matches
  3. Report: timeline grouped by date/​project

"Continue work on X"

  1. Grep tool → find sessions mentioning X
  2. Read tool → examine most relevant session
  3. Analyze: goal, accomplishments, pending items, decisions
  4. Generate continuation prompt (see template below)

Continuation Prompt Template

Continuing work from [date] on [project]:

## Original Goal
[from first user message]

## What Was Done
- [accomplishments]
- [files changed]

## Pending
- [incomplete items]

## Key Decisions
- [choices that carry forward]

## Resume Point
[specific next task]

jq Patterns

# Decode project path (inline)
echo "-Users-foo-bar" | sed 's/^-/\//; s/​-/\//g'

# Extract timestamps from session
jq -r '.timestamp // empty' file.jsonl | sort

# User messages only
jq -c 'select(.type=="user")' file.jsonl

# Filter by text content
jq -c 'select(.message.content[].text | test("pattern";"i"))' file.jsonl

# Get first/​last timestamp
jq -rs '[.[].timestamp | select(.)] | sort | .[0], .[-1]' file.jsonl

Related Skills

TopicSkill
Storage internals, /​renamecc-internals
Permission configcc-configuring-permissions

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View