ThoughtDAG
Read-only MCP server that finds past AI coding conversations by file or phrase
- Pricing
- Open source
- Platforms
- CLI, self-hosted, macOS
- Runs
- Locally
- Version
- 0.2.2
- Listing updated
- 1 day ago
About ThoughtDAG
ThoughtDAG is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
ThoughtDAG builds a local index of agent sessions already on your machine, from Claude Code, Codex, DeepSeek Harness, Pi and ThoughtDAG canvases, keyed by the files each turn read, wrote or edited. Facts come straight from tool calls rather than free text or a model. Observed edits are marked separately from candidate explanations inferred from an answer, which the docs say are not verified reasons.
The MCP server offers four read-only tools and cannot edit a canvas or a source session. thoughtdag setup mcp registers it for Claude Code in the project's .mcp.json and for Codex in the user config; thoughtdag setup rules can add a marked block to CLAUDE.md and AGENTS.md asking agents to check history before editing a file, and removes it again on request.
It needs Node.js 20 or newer. Derived indexes live under ~/.thoughtdag and can be deleted with thoughtdag purge. Retrieved history is returned to the calling agent, which may pass it to its model provider, so private history deserves a check of the client's settings.
Install
Run in a terminal
claude mcp add thoughtdag -- npx -y thoughtdagAdd to claude_desktop_config.json
{
"mcpServers": {
"thoughtdag": {
"command": "npx",
"args": [
"-y",
"thoughtdag"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"thoughtdag": {
"command": "npx",
"args": [
"-y",
"thoughtdag"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"thoughtdag": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"thoughtdag"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"thoughtdag": {
"command": "npx",
"args": [
"-y",
"thoughtdag"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"thoughtdag": {
"command": "npx",
"args": [
"-y",
"thoughtdag"
]
}
}
}Tools this server provides (4)
Taken from the project documentation; the running server may differ.
- why_check
- One-line yes/no check whether a path has history
- why_file
- Matching turns and observed file changes for a path
- find
- Exact matches in questions, answers or materials
- recall_turn
- Full question, answer and tool trail for one turn
What it does
- File history lookup
- Lists the turns that touched a file, URL or arXiv paper.
- Exact phrase search
- Finds a phrase across questions, answers or attached materials.
- Full turn recall
- Prints a single turn's question, answer and tool trail.
- Observed versus inferred
- Separates recorded edits from candidate explanations.
- Local index
- Derived data stays in ~/.thoughtdag with restrictive permissions.
- Project rules helper
- Optionally adds and removes a history-check block in CLAUDE.md and AGENTS.md.
Good for
- Ask why a file looks the way it does before editing it
- Find the conversation where a specific phrase was discussed
- Check whether a file has any past agent history
- Recover the full tool trail of an earlier turn
Pricing
Open source
Free npm package
Prices change. Check chenxiachan.github.io before you buy.
ThoughtDAG FAQ
Can it modify my sessions?
No. Session files are read, never written, and the MCP tools are read-only.
Which agents' history does it read?
Claude Code, Codex, DeepSeek Harness, Pi and ThoughtDAG canvas conversations.
How do I start the server?
Run npx -y thoughtdag@0.2.2 mcp, or thoughtdag setup mcp inside a project.
How do I remove its data?
thoughtdag purge deletes all derived data, or only rebuildable caches with --cache.
Is ThoughtDAG free?
Yes. ThoughtDAG is open source, so you can use and self-host it for free.
How do I add ThoughtDAG to Claude Code?
Run this command in your terminal: claude mcp add thoughtdag -- npx -y thoughtdag
What are the best alternatives to ThoughtDAG?
The closest alternatives to ThoughtDAG are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to ThoughtDAG

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools