DiffMind
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DiffMinddocument changes for user authentication implementation"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DiffMind
Your AI writes the code. DiffMind makes sure it explains why.
Vibe coding lets AI ship features fast. DiffMind makes sure you still own the project.
When you tell your AI agent "add user authentication", it writes the code and the feature works. Three weeks later you want to change the logout flow, but you don't know where sessions are stored, how token refresh works, or why it didn't use OAuth. You've become a stranger to your own codebase.
This is the hidden cost of vibe coding: you know what features exist, but not why they were designed this way, what trade-offs were made, or how to safely change them. You lose ownership. Maintenance becomes archaeology. Technical debt piles up because you're afraid to touch code you don't understand.
DiffMind closes this gap. It's an MCP server for Claude Code that forces AI agents to explain every decision — not just "what I did", but "why this approach", "what I rejected", and "what trade-offs I accepted". You get the speed of AI-assisted development with the deep understanding of hand-written code.
Why existing tools fall short
Git commits | Chat history | Code review | DiffMind | |
What changed | ✅ | partial | ✅ | ✅ |
Why this approach | ❌ | buried | sometimes | ✅ enforced |
Rejected alternatives | ❌ | lost | rarely | ✅ required |
Trade-offs accepted | ❌ | ❌ | sometimes | ✅ required |
Maintains ownership after AI coding | ❌ | ❌ | ❌ | ✅ |
Quality enforced at write | ❌ | ❌ | human effort | ✅ blocked |
Searchable + commitable | ✅ | ❌ | ❌ | ✅ |
Searchable + commitable | ✅ | ❌ | ❌ | ✅ |
Git history tells you what changed. Chat logs record a conversation that's forgotten next session. Code review catches problems after the fact, when changing course is expensive.
DiffMind is the only tool that captures the AI's reasoning before the code is saved — and rejects it if the reasoning is vague.
Related MCP server: reforge-mcp
How it works
Developer starts a session → AI writes code → AI calls explain_change()
↓ ↓
goal recorded rationale + rejected alternatives + trade-offs
pass quality gate → saved to .diffmind/
↓
session closed → digest Markdown generated
call chain diff (Mermaid)
commit message draftedEvery explanation lives in .diffmind/ — plain JSON + Markdown, commitable alongside
your code, diffable in PRs, readable without any tooling.
Quick start
One-click installation:
curl -fsSL https://raw.githubusercontent.com/akay1121/DiffMind/main/install.sh | bashOr manually:
1. Add to your Claude Code project
# In your project directory
npm install -g diffmind # or: npx diffmindMerge hooks/settings-fragment.json into your project's .claude/settings.json:
{
"hooks": {
"PreToolUse": [{ "matcher": "Write|Edit", "hooks": [{ "type": "command", "command": "diffmind session auto-start" }] }],
"Stop": [{ "matcher": "", "hooks": [{ "type": "command", "command": "diffmind session auto-close" }] }]
},
"mcpServers": {
"diffmind": {
"command": "npx",
"args": ["-y", "diffmind"],
"env": { "DIFFMIND_ROOT": "${workspaceFolder}" }
}
}
}Drop templates/CLAUDE.md into your project's CLAUDE.md (or append it).
2. Add .diffmind/ to git
echo "/.diffmind/sessions/" >> .gitignore # optional: exclude raw session files
# explanations/ and digests/ are worth commiting — that's the point
git add .diffmind/3. Start a session
The hooks handle this automatically. Or manually:
start_session("Refactor auth to use JWT refresh tokens")See realistic examples: docs/examples.md shows full workflows for adding features, fixing bugs, and refactoring.
MCP tools
Tool | When to call |
| Before making any changes |
| Before touching existing code |
| After every meaningful edit |
| When done for this conversation |
| Look up a past explanation |
| Find relevant past decisions |
| Browse recent history |
| First time on a new project |
| Persist project conventions |
Quality gate
DiffMind blocks or warns when explanations are vague. You can't save:
A rationale under the minimum length for the change scale
A rationale that just repeats the summary (Jaccard similarity > 0.7)
Filler phrases: "better maintainability", "cleaner code", "improved readability"
A
structuralorarchitecturalchange with no rejected alternativesconfidence: "verified"with no verification steps listed
Warnings (non-blocking) catch things like missing call chain on structural changes, suspiciously many files for a "local" scale, or opening the rationale with an action verb.
See it in action
Want the full picture before installing? A worked walkthrough of implementing login
takes a single request — "帮我完成登录功能" — through the whole DiffMind workflow: session
start, three explain_change calls with genuine trade-offs (bcrypt over plaintext, sessions
over JWT, a deliberately vague 401 to block email enumeration), the generated digest with its
Mermaid call chain diff, the terminal box, the drafted commit message, and — three weeks later —
recall_change and search_changes handing the reasoning back just as the developer needs it
to add OAuth.
Storage layout
.diffmind/
├── conventions.json project coding conventions
├── sessions/ one JSON per session (start → close)
├── explanations/ one JSON per explain_change call
└── digests/ Markdown digest per session, with Mermaid call chain diffAll files are human-readable. digests/ is the main artifact for code review.
Roadmap
Phase 1 — MCP server, 9 tools, quality gate, session model
Phase 1.5 —
diffmindCLI, Claude Code hook auto-trigger, terminal explanation pickerPhase 2 — Call chain diff visualization (Mermaid, changed nodes in red)
Phase 2.5 — Git commit message injection (
prepare-commit-msg)Phase 3 — Web UI for browsing sessions and explanation history
Contributing
Issues and PRs welcome. This project follows its own conventions —
run start_convention_interview() in DiffMind before contributing code.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceAn MCP server that provides agentic code review powered by OpenAI-compatible models, designed for use with Claude Code.Last updated1MIT
- Alicense-qualityBmaintenanceAn MCP server that connects Claude Code to your codebase for automated code cleanup with scanning, planning, atomic fixes, and rollback safety.Last updated2MIT
- Alicense-qualityBmaintenanceMCP server enabling Claude to consult Codex (GPT-5.x) mid-task for second opinions, plan/diff review, brainstorming, and codebase exploration via structured debates and permission-controlled interactions.Last updated2MIT
- Alicense-qualityCmaintenanceA local MCP server that provides adversarial code review by having one frontier agent (Claude Code or Codex) critique code changes using the other agent (Codex or Claude Code) with full repository access, enabling a genuine second opinion on code and plans.Last updated2MIT
Related MCP Connectors
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
An MCP server that gives your AI access to the source code and docs of all public github repos
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/akay1121/DiffMind'
If you have feedback or need assistance with the MCP directory API, please join our Discord server