Skip to content

LinuxIsCool/claude-code-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Claude Code Transcript Explorer πŸ”

A comprehensive, aesthetic search interface for exploring Claude Code conversation transcripts. Features multi-faceted search capabilities, real-time analytics, and beautiful visualizations.

Screenshots

Search Interface

Advanced Search Interface

Analytics Dashboard

Analytics Dashboard

Search Results

Search Results View

Visualizations

Data Visualizations

Features

πŸ” Advanced Search

  • Multiple Search Modes: Fuzzy matching, exact match, and regex patterns
  • Field-Specific Search: Search in content, session IDs, or tool calls
  • Smart Filtering: Filter by role, date range, tools used, and models
  • Contextual Results: View messages with surrounding context
  • Score-Based Ranking: Results ranked by relevance

πŸ“Š Analytics Dashboard

  • Tool usage statistics and trends
  • Model distribution analysis
  • Activity timeline visualization
  • Session statistics and patterns
  • Export capabilities for further analysis

🎨 Beautiful Interface

  • Modern, gradient-based design
  • Dark/light theme support
  • Responsive layout
  • Syntax highlighting for code
  • Interactive charts with Plotly

⚑ Performance

  • Efficient indexing for fast searches
  • Parallel file loading
  • Caching support for repeated queries
  • Incremental loading for large datasets

Installation

  1. Install required dependencies:
pip install -r requirements.txt
  1. Run the application:
python main.py

Usage

GUI Mode (Default)

python main.py --mode gui --port 7860

Access the interface at http://localhost:7860

CLI Mode

Search from command line:

python main.py --mode cli --search "your search query"

Export Mode

Export all transcripts:

python main.py --mode export --export-format json --output transcripts.json

Command Line Options

  • --mode: Run mode (gui, cli, export)
  • --data-path: Path to transcript directory (default: /home/ygg/.claude/projects)
  • --port: Port for Gradio server (default: 7860)
  • --share: Create public share link
  • --search: Search query for CLI mode
  • --export-format: Export format (json, csv, markdown)
  • --output: Output file path
  • --cache-dir: Directory for search index cache

Architecture

Core Components

Data Models (core/data_models.py)

  • Message: Individual message representation
  • Conversation: Complete conversation session
  • SearchResult: Search result with context
  • ToolCall: Tool usage information

Data Loader (core/data_loader.py)

  • TranscriptLoader: Loads and parses JSONL files
  • IncrementalLoader: For large dataset handling
  • Parallel loading with progress tracking
  • Error handling and reporting

Search Engine (core/search_engine.py)

  • SearchIndex: Efficient indexing system
  • SearchEngine: Multi-mode search capabilities
  • SearchQuery: Query configuration
  • Fuzzy matching with rapidfuzz
  • Regex pattern support

User Interface (ui/app.py)

  • Gradio-based web interface
  • Responsive design with custom CSS
  • Interactive visualizations
  • Export functionality

Search Tips

Fuzzy Search

  • Tolerant to typos and variations
  • Best for general exploration
  • Example: claud code finds "Claude Code"

Exact Match

  • Finds exact occurrences
  • Case-insensitive by default
  • Use for specific phrases

Regex Patterns

  • Complex pattern matching
  • Example: error.*failed finds "error...failed"
  • Supports standard regex syntax

Filtering

  • Combine multiple filters for precision
  • Date ranges for temporal analysis
  • Tool filters for specific functionality
  • Role filters for user/assistant messages

Export Formats

JSON

  • Complete structured data
  • Preserves all metadata
  • Ideal for programmatic processing

CSV

  • Tabular format for spreadsheets
  • Basic fields included
  • Good for statistical analysis

Markdown

  • Human-readable documentation
  • Formatted for easy reading
  • Includes code highlighting

Performance Optimization

For Large Datasets

  1. Use cache directory for index persistence
  2. Enable incremental loading
  3. Adjust worker count for parallel loading
  4. Use specific date ranges in searches

Memory Management

  • Incremental loader for streaming
  • Configurable batch sizes
  • Automatic garbage collection

Troubleshooting

No Results Found

  • Check search query syntax
  • Verify filters aren't too restrictive
  • Ensure transcripts are loaded

Slow Performance

  • Enable caching with --cache-dir
  • Reduce parallel workers if memory constrained
  • Use date filters to limit scope

Loading Errors

  • Check file permissions
  • Verify JSONL format
  • Review error report in logs

Development

Project Structure

transcript_explorer/
β”œβ”€β”€ core/               # Core functionality
β”‚   β”œβ”€β”€ data_models.py  # Data structures
β”‚   β”œβ”€β”€ data_loader.py  # File loading
β”‚   └── search_engine.py # Search logic
β”œβ”€β”€ ui/                 # User interface
β”‚   └── app.py         # Gradio application
β”œβ”€β”€ main.py            # Entry point
└── requirements.txt   # Dependencies

Extending Functionality

  • Add new search modes in SearchMode enum
  • Implement custom filters in SearchEngine
  • Add visualization types in app.py
  • Create new export formats in main.py

License

This tool is provided as-is for exploring Claude Code transcripts.

About

Search your claude code historic transcripts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published