🤖 Built with Claude Code - This entire project was created through pair programming with Claude Code, demonstrating its capability to build tools that enhance its own functionality!
Search and reference your Claude Code conversation history directly from Claude!
- 🔍 Full-text search across all your Claude Code conversations
- 📝 View complete conversations with context
- 🏷️ Browse by project to see all your work
- ⚡ Fast keyword search using SQLite FTS5
- Clone this repository:
git clone https://github.com/tim0120/claude-code-history-mcp.git
cd claude-code-history-mcp- Install dependencies and build:
npm install
npm run build- Add to your Claude Code MCP settings (
~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"claude-history": {
"command": "node",
"args": ["/path/to/claude-code-history-mcp/dist/index.js"]
}
}
}- Restart Claude Code
When you first use the MCP, you need to index your existing conversations:
Use the tool: index_conversations
This will scan your ~/.claude/projects directory and index all conversations.
Search for specific errors, code patterns, or topics:
Use the tool: search_history with query: "CORS error"
Use the tool: search_history with query: "database connection"
Use the tool: search_history with query: "TypeError"
After searching, you can get the full conversation:
Use the tool: get_conversation with conversationId: "abc123"
See all your indexed projects:
Use the tool: list_projects
The MCP:
- Reads your Claude Code conversation history from
~/.claude/projects - Indexes conversations in a local SQLite database
- Provides full-text search capabilities
- Returns relevant snippets and full conversation details
- Database location:
~/.claude-code-mcp/history.db - No data is sent to external services
- Your conversation history stays local
- Semantic search using embeddings
- Auto-indexing with file watcher
- Conversation summarization with GPT-4
- Export/import functionality
- Search filters (date, project, success/failure)
Contributions welcome! Please feel free to submit issues and PRs.
MIT