The Claude Historian server enables efficient search and analysis of Claude Code conversation history to find past solutions, track changes, and understand usage patterns.
Search Conversations: Find relevant conversations by query with optional project and timeframe filters
Find File Context: Retrieve conversations related to specific file paths
Find Similar Queries: Locate previous questions similar to a given query
Get Error Solutions: Discover how similar errors were resolved in past conversations
List Recent Sessions: View recent conversation sessions
Extract Compact Summary: Obtain a summary of a specific conversation session
Analyze Tool Patterns: Identify successful patterns of tool usage to improve workflows
Provides access to historical Docker configuration solutions and authentication troubleshooting
Enables finding information about Git operations during feature branch management and historical changes
Allows retrieving historical solutions for Kubernetes deployment issues and container crashes
Enables searching for past React-related solutions including infinite re-render loops and state management approaches
Provides access to historical solutions for Redis connection pooling problems
Allows finding historical discussions on state management comparing Redux with alternatives
claude-historian
A Model Context Protocol (MCP) server for searching your Claude Code (& Claude Desktop) conversation history. Find past solutions, track file changes, and learn from previous work.
install
Requirements:
From shell:
From inside Claude (restart required):
From any manually configurable mcp.json
: (Cursor, Windsurf, etc.)
That's it; there is no npm install
required as there are no external dependencies or local databases, only search algorithms.
However, in the unlikely event that you pull the wrong package / npx
registry is out of date, you can force resolution issues in certain environments with:
features
MCP server that gives Claude access to your conversation history. Fast search with smart prioritization.
Runs locally (with cool shades [⌐■_■]
):
methodology
How claude-historian works:
Core optimizations:
- parallel processing:
Promise.allSettled
for 6x speed improvement across projects and files - workflow detection: Captures tool sequences like "Edit → Read → Bash" patterns
- enhanced file matching: Comprehensive path variations with case-insensitive matching
- intelligent deduplication: Content-based deduplication preserving highest-scoring results
- intelligent truncation: Never truncates mid-function or mid-error
- Claude-optimized formatting: Rich metadata with technical content prioritization
Search strategies:
- JSON streaming parser (parseJsonlFile): Reads Claude Code conversation files on-demand without full deserialization
- LRU caching (messageCache): In-memory cache with intelligent eviction for frequently accessed conversations
- TF-IDF inspired scoring (calculateRelevanceScore): Term frequency scoring with document frequency weighting for relevance
- Query classification (classifyQueryType): Naive Bayes-style classification (error/implementation/analysis/general) with adaptive limits
- Edit distance (calculateQuerySimilarity): Fuzzy matching for technical terms and typo tolerance
- Exponential time decay (getTimeRangeFilter): Recent messages weighted higher with configurable half-life
- Parallel file processing (getErrorSolutions): Concurrent project scanning with early termination for 0.8s response times
- Workflow pattern recognition (getToolPatterns): Detects tool usage sequences and related workflows for learning
- Enhanced file context (findFileContext): Multi-project search with comprehensive path matching
- Content-aware truncation (smartTruncation): Intelligent content boundaries over arbitrary character limits
- Technical content prioritization (formatSearchResults): Code blocks, errors, and file paths get full preservation
- Query similarity clustering (findSimilarQueries): Semantic expansion and pattern grouping for related questions
File access:
- Reads from:
~/.claude/conversations/
- Zero persistent storage or indexing
- Never leaves your machine
development
Package requirements:
- Node.js: >=20.0.0 (ES modules support)
- npm: >=10.0.0 (package-lock v3)
- Runtime: Only
@modelcontextprotocol/sdk
dependency - Zero external dependencies for production deployment
- Optimized: 50% token reduction with parallel processing
Development workflow:
Contributing:
- Please fork the repository and create feature branches
- Test with large conversation histories before submitting PRs
- Follow TypeScript strict mode and MCP protocol standards
Learn from examples:
- Official MCP servers for reference implementations
- TypeScript SDK for best practices
- Creating Node.js modules - NPM package development guide
desktop
Claude Desktop support is currently blocked by LevelDB locks and Electron sandboxing. You will still search Claude Desktop from Claude Code, but only when the Claude app is closed.
A DXT package and build is available for future compatibility; further investigations are ongoing. Feel free to test with it.
license
Claude Fauchet (1744-1793), French Historian
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
MCP server that lets you search your Claude Code conversation history to find past solutions, track file changes, and learn from previous work.
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.Last updated -15248MIT License
- -securityFlicense-qualityAn MCP server that integrates with Claude to provide smart documentation search capabilities across multiple AI/ML libraries, allowing users to retrieve and process technical information through natural language queries.Last updated -
- AsecurityAlicenseAqualityAn MCP server implementation that helps Claude remember and learn from programming errors by storing, retrieving, and finding similar errors with full context.Last updated -65MIT License
- AsecurityAlicenseAqualityMCP server that provides Claude AI assistants with the ability to search the web, get news, and perform research using the You.com API.Last updated -4MIT License