Claude History MCP

Claude History MCP indexes past Claude Code chats, extracts decisions and error fixes and injects project context

  • 69 ★ on the repository
  • Last commit
  • MIT
MCP server

Broad access

Why this level

  • The server reads every Claude Code transcript, which may hold keys and personal data, and builds a disk index from them
  • The cloud_sync tools send knowledge and sessions to a remote server, and the hook edits `~/.claude/settings.json`
All reasons and checks

jhammant/claudehistorymcp

Install

Manual install

claude mcp add claude-history -- node "/path/to/ClaudeHistoryMCP/dist/index.js"

After `npm install`, `npm run build` and `npm run build-index` in the repository clone.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • The server reads every Claude Code transcript, which may hold keys and personal data, and builds a disk index from them
  • The cloud_sync tools send knowledge and sessions to a remote server, and the hook edits `~/.claude/settings.json`

This is third-party code. Review the repository files before installing.

What it does

Claude Code stores full transcripts as JSONL files in `~/.claude/projects/`. The server indexes them with hybrid search: BM25 gives keyword precision, TF-IDF adds semantic recall, and results merge with Reciprocal Rank Fusion. Queries accept the filters `project:`, `before:7d`, `after:` and `tool:Bash`, and recent chats plus a match with the current folder raise the score. After a session ends, when the file stops changing for five minutes, the server extracts decisions, fixes and error and resolution pairs. The tools `search_history`, `find_solutions`, `get_session_summary`, `list_projects`, `find_patterns` and `get_project_context` hand results to the agent. You can also install a `SessionStart` hook that injects project history into a new session, and a `/claude-history` skill. The index refreshes itself when new files appear, and about 170 sessions index in around 9 seconds.

Who it is for. Claude Code users with a large session history who need to find quickly how a problem was solved or an error fixed before.

Good fit when

  • You need to recall how a failing test was fixed a week ago and find that session
  • A new session in a project should start with decisions and context from earlier ones
  • You want recurring topics and problems across all projects
  • A short summary of one session by its ID is needed
  • Search is limited by project and period, for example `project:api before:7d`

Not a fit when

  • You need memory of user preferences: the server searches history and builds no profile
  • Conversations must not be indexed because of confidential data in transcripts
  • You work outside Claude Code: only its JSONL files are indexed

Example request

Find in history how we fixed the database connection error in the api project and show that session

MCP

Transport
stdio
Authentication
not required

Limitations

The server reads every transcript under `~/.claude/projects/` and stores the index and extracted knowledge in `~/.claude-history-mcp/`. The README includes the `cloud_sync_push`, `cloud_sync_pull` and `cloud_sync_status` tools that send knowledge and sessions to a cloud server, so enable them deliberately. Installation runs from a repository clone with `npm install` and `npm run build`, and there is no registry package. The hook and skill install with a separate `npm run install-hook` and change `~/.claude/settings.json`. Knowledge extraction works from phrase patterns such as "decided to" and "fixed".

How to disable. Run `claude mcp remove claude-history`, turn off the hook in `~/.claude/settings.json` and delete the `~/.claude-history-mcp/` folder with the index.

FAQ

How do I connect Claude History MCP?

Build the project with `npm install` and `npm run build`, build the index with `npm run build-index` and run `claude mcp add claude-history -- node "/path/to/ClaudeHistoryMCP/dist/index.js"`.

Which tools does the server have?

Six for history work: `search_history`, `find_solutions`, `get_session_summary`, `list_projects`, `find_patterns`, `get_project_context`. Three more manage cloud sync.

What does the SessionStart hook do?

It places relevant project history at the start of a new session. It installs with `npm run install-hook` and is optional.

How fast does the index build?

About 9 seconds for 170 sessions, search takes under 200 ms and new files are picked up automatically.

How is it different from history viewers?

Viewers show conversations to people, while the server hands search and found solutions to the agent itself through MCP tools.

Discussion

No questions or reviews yet.

Local search across your whole Claude Code session history: decisions, commands, variable values and code you already wrote, through 13 MCP tools

MCP serverBroad access307Repository stars

Copies Claude Code and Codex sessions before auto-deletion and answers with a hash-backed citation or an abstention.

MCP serverExtended access81Repository stars
Needs a VPN

A Claude Code project with MCP servers and hooks: long-term memory, needs, social context, camera, voice and sensors

WorkflowBroad access377Repository stars

claude-mem-lite keeps decisions, fixes and context from Claude Code sessions in one SQLite file with full-text search

PluginExtended access68Repository stars
Official

The Supermemory plugin for Claude Code: persistent memory across sessions with automatic prompt recall, conversation capture and a codebase index

PluginBroad access2.8KRepository stars

A Claude Code configuration with safeguards: approvals for risky actions, command audit, sub-agents and 65 on-demand MCP servers.

WorkflowBroad access59Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
Claude History MCP (this card)nonot required69
OpenHistorynoAPI key137a similar history search server, while this one adds hybrid BM25 with TF-IDF, solution extraction and a project context hook
Claude Code History Viewerno2,314a conversation viewer for people, while this server gives search and found solutions to the agent itself

README in short

The README explains what the server does with Claude Code history and shows a diagram of the server, skill and hook. It then covers the search engine, knowledge extraction, data storage, a four step install and a table of nine tools.

README badge

Report a problem