Accessing and Searching Claude Code Conversation History

· combray's blog


Accessing and Searching Claude Code Conversation History #

Summary #

Claude Code stores all conversation history locally in ~/.claude/ but doesn't provide built-in search capabilities beyond resuming your last 3 sessions. For this project, you have 700+ session files scattered across the project-specific directory at ~/.claude/projects/-Users-wschenk-The-Focus-AI-2025-11-20-ai-engineering-code-summit/.

The recommended approach is a two-tier solution: create a custom /history command for quick access to your conversation list, and install claude-conversation-extractor (a Python CLI tool) for powerful search and export capabilities. For visual exploration, the Claude Code History Viewer desktop app provides heatmaps and analytics.

Project Context #

This project (AI Engineering Code Summit 2025) has extensive Claude Code usage with:

Detailed Findings #

Option 1: Built-in Commands (Limited) #

What it is: Claude Code's native session resumption features.

Why consider it: Zero setup, immediately available.

How to use:

1# Continue your most recent session
2claude -c
3# or
4claude --continue
5
6# Interactive picker for last 3 sessions
7claude --resume

Trade-offs:

What it is: A markdown file that instructs Claude Code to read and format your conversation history.

Why consider it: Gives you a searchable table of ALL conversations directly in any Claude Code session.

How to implement:

  1. Create the global commands directory:
1mkdir -p ~/.claude/commands
  1. Create the history command file:
 1cat > ~/.claude/commands/history.md << 'EOF'
 2# Conversation History Viewer
 3
 4Read my global conversation history from `~/.claude/history.jsonl` and display it as a formatted table.
 5
 6For each conversation entry, show:
 71. Entry number
 82. Human-readable date/time (e.g., "Nov 23, 2025 20:15")
 93. Project folder name (just the last segment of the path)
104. First 60-80 characters of the conversation topic/first message
115. Session ID (for resuming)
12
13Sort by most recent first. Format as a markdown table.
14
15If the user asks to filter, search the message content for their keywords.
16EOF
  1. Use it in any Claude Code session:
/history
  1. Resume any found session:
1claude --resume <session-id>

Trade-offs:

Option 3: Claude Conversation Extractor (Best for Search & Export) #

What it is: A Python CLI tool for searching and exporting Claude Code conversations.

Why consider it: Real-time search across all projects, multiple export formats, zero config.

How to install:

1# Using pipx (recommended for CLI tools)
2pipx install claude-conversation-extractor
3
4# Or with pip
5pip install claude-conversation-extractor

How to use:

 1# Interactive mode with search
 2claude-start
 3
 4# Direct search
 5claude-search "speaker decorator"
 6
 7# List all conversations
 8claude-extract --list
 9
10# Export specific conversation
11claude-extract <session-id>
12
13# Export all conversations
14claude-extract --all
15
16# Export with full details (tool calls, MCP, etc.)
17claude-extract --detailed
18
19# Different formats
20claude-extract --format json
21claude-extract --format html
22claude-extract --format markdown  # default

For this project specifically:

1# Search for speaker-related conversations
2claude-search "speaker"
3
4# Search for theme-related work
5claude-search "theme"
6
7# Search for specific commands used
8claude-search "conference-analysis"

Trade-offs:

Option 4: Claude Code History Viewer (Desktop App) #

What it is: A Tauri-based desktop application for browsing conversation history with analytics.

Why consider it: Visual interface, usage analytics, syntax highlighting.

How to install:

Download from: https://github.com/jhlee0409/claude-code-history-viewer/releases

Or build from source:

1git clone https://github.com/jhlee0409/claude-code-history-viewer
2cd claude-code-history-viewer
3./scripts/setup-build-env.sh
4pnpm tauri:build:auto

Key features:

Trade-offs:

Option 5: Direct File Grep (Quick & Dirty) #

What it is: Using standard Unix tools to search JSONL files directly.

Why consider it: Instant, no installation, works right now.

How to use:

 1# Search all sessions in this project for a term
 2grep -l "speaker" ~/.claude/projects/-Users-wschenk-The-Focus-AI-2025-11-20-ai-engineering-code-summit/*.jsonl
 3
 4# Search and see context
 5grep -h "speaker" ~/.claude/projects/-Users-wschenk-The-Focus-AI-2025-11-20-ai-engineering-code-summit/*.jsonl | head -20
 6
 7# Find sessions from a specific date (by file modification time)
 8ls -lt ~/.claude/projects/-Users-wschenk-The-Focus-AI-2025-11-20-ai-engineering-code-summit/*.jsonl | head -20
 9
10# Search global history for topics
11grep "conference" ~/.claude/history.jsonl

Trade-offs:

Recommendation #

For this project, implement a two-tier approach:

  1. For day-to-day use: Create the custom /history command (Option 2). This gives you quick access to your conversation list without leaving Claude Code.

  2. For deep search/export: Install claude-conversation-extractor (Option 3). When you need to find a specific conversation or export your work, this provides the most powerful search.

  3. Optional bonus: Install the History Viewer desktop app if you want to visualize your usage patterns and get analytics.

Quick Setup Script #

 1# Create /history command
 2mkdir -p ~/.claude/commands
 3cat > ~/.claude/commands/history.md << 'EOF'
 4Read ~/.claude/history.jsonl and show as a table with:
 5- Entry # | Date | Project | Topic (first 60 chars) | Session ID
 6Sort newest first. Filter by user's keywords if provided.
 7EOF
 8
 9# Install search tool
10pipx install claude-conversation-extractor
11
12echo "Done! Use /history in Claude Code or claude-search in terminal"

When NOT to Use This #

Sources #

last updated: