Branchable LLM history DAG + encrypted context capsules agents can save, restore, and crypto-shred.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Treat your AI conversation history like a Git repository β capture every call, branch from any turn, and diff outcomes side by side. All on your machine.
Try in 10s Β· Features Β· Install Β· Quick start Β· MCP Β· Capsules

What you're seeing: the conversation DAG with a fork off the debug turn, the node inspector (request/response, tokens, provenance), and the β Compare view diffing two branches with per-token deltas. The green β streaming badge shows live capture β nodes appear as they're recorded.
ForkMind captures every LLM call into a local .forkmind/ directory, visualizes
the conversation as a Directed Acyclic Graph (DAG), and lets you branch,
diff, and replay from any point in the history. Works with any
OpenAI-compatible API, defaulting to free, open-source models via
Ollama β also Anthropic, Groq, OpenRouter, Together,
vLLM, and LM Studio.

Debugging agentic / tool-calling flows means re-running the same prompt with tiny tweaks over and over, then scrolling through terminal logs to see what changed. ForkMind records each run as a node in a conversation tree, so instead of re-reading logs you see the whole history, branch from any turn, and compare outcomes visually.
Everything is plain JSON on disk. No database, no account, no telemetry β nothing leaves your machine except the LLM call you were already making.
.forkmind/. Works from any language via an OpenAI-compatible proxy;
streaming responses are reconstructed (text and fragmented tool-call args)..forkmind/ history mid-task (recall
what they tried, trace how they got somewhere, self-correct).forkmind demo β one command opens the dashboard on a pre-seeded sample
DAG, zero setup and zero API key.No API key, no setup: the dashboard opens with a pre-seeded conversation DAG β a coding-agent debug session that forks into a failed fix and a winning fix, plus an archived context capsule. Everything lives in a throwaway temp directory; your project is never touched. If a local Ollama is running, Fork from here works live against your local model.
Once you're in, try:
No npm registry needed either β ForkMind runs straight from the git link, and the dashboard builds automatically on install:
ForkMind ships a Claude Code plugin (skill + /forkmind command) so Claude knows
when and how to drive it β same install flow as any marketplace plugin:
The plugin bundles:
forkmind skill β Claude reaches for ForkMind whenever you ask it to debug
a prompt, compare models, branch from a past turn, or regression-test a call./forkmind command β start / branch / test / mcp on demand.forkmind-debugger agent β runs model/prompt comparisons in an isolated
context and returns a compact verdict instead of dumping transcripts..forkmind/ history
(recall attempts, trace lineage, self-correct) with zero manual config.The CLI is still what runs the proxy + dashboard; the plugin is the glue that teaches Claude to use it.
Run the full example:
The SDK wrapper is convenience, not a requirement. ForkMind's proxy speaks the
OpenAI-compatible wire protocol, so capture works from any language: set
your client's base URL to http://localhost:4500/v1 and you're recorded. Chain
turns into a tree by passing back the x-forkmind-node-id from the previous
response as the next request's x-forkmind-parent header (the JS wrapper just
automates this).
Go, Ruby, Rust, Java β same deal: base URL + the two headers. The dashboard, branching, MCP, and regression testing all work regardless of source language.
ForkMind ships thin adapters for the two biggest JS LLM ecosystems. Both route through the same proxy, so capture, branching, the dashboard, MCP, and regression all work unchanged β no model-class swap, no callbacks.
Both honor FORKMIND_PROXY (proxy base URL) and take an explicit baseURL /
upstream per instance.
ForkMind is provider-agnostic β it forwards your auth headers verbatim and lets you set the upstream per client. Anything OpenAI-compatible just works:
| Provider | upstream | apiKey |
|---|---|---|
| Ollama (local) | http://localhost:11434 | any string |
| LM Studio (local) | http://localhost:1234 | any string |
| Groq (free tier) | https://api.groq.com/openai | gsk_... |
| OpenRouter | https://openrouter.ai/api | sk-or-... |
| Together | https://api.together.xyz | your key |
| OpenAI | https://api.openai.com (default) | sk-... |
You can also override per request with the x-forkmind-upstream header if you
call the proxy directly instead of via the SDK.
sha256(request + parentId) β first 12 hex chars.
Same prompt under the same parent collapses to one node. The ID doesn't depend
on the response, so it can be returned as a header even before a streamed body
finishes.dashboard/src/lib/diff.js).POST /api/replay walks a captured lineage from an edited node to
a chosen leaf, regenerating each assistant turn against the modified history
while original user turns and tool results re-apply verbatim. The new chain is
saved as a sibling branch.saveNode emits on an in-process bus; GET /api/stream
relays each new node to the dashboard over SSE, so the canvas updates without
polling.ForkMind ships an MCP server so an AI agent
can read its own .forkmind/ history mid-task and self-correct β recall what it
already tried, see how it reached a state, or search past attempts.
One-line install via Smithery (configured in
smithery.yaml) β run it from your project root so it sees
your .forkmind/:
β¦or register it manually with any MCP client (Claude Desktop / Claude Code / Cursor / Cline):
Tools exposed:
| Tool | Purpose |
|---|---|
forkmind_recent | Newest captured turns (compact) |
forkmind_get_node | Full request + response for one node |
forkmind_lineage | Rootβnode path β the exact context that produced a state |
forkmind_children | Sibling branches forking from a node |
forkmind_search | Substring search across all requests/responses |
forkmind_stats | Tree totals: nodes, roots, leaves, providers |
forkmind_context_save | Offload context into an encrypted DAG capsule |
forkmind_context_list | List saved capsules (title, digest, size, age) |
forkmind_context_digest | Digest + segment map β cheap pre-restore probe |
forkmind_context_restore | Full or per-segment restore, integrity-verified |
forkmind_context_forget | Irreversible crypto-shred (requires id echo) |
forkmind_context_replicas | Replica (RAID) health, optional sync |
forkmind_context_stats | Aggregate stats: count, bytes, estimated tokens |
forkmind_context_export | Portable passphrase-encrypted bundle |
forkmind_context_import | Import + re-verify a bundle, re-wrap locally |
The server reads the .forkmind/ in its working directory β point the client's
cwd at your project.
Most context managers treat a full window as a cache-eviction problem: truncate and lose it. ForkMind capsules invert that β persist first, verify, then compact. A capsule is an immutable, content-addressed DAG of context segments, AES-256-GCM encrypted on disk, restorable in full or one segment at a time.
Same engine over HTTP (POST/GET/DELETE :4500/api/contextβ¦) and via five MCP
tools, so agents can archive their own context mid-task and pull it back later.
The Claude Code plugin ships a forkmind-archivist skill + subagent that
teaches Claude the offload contract: save β verify on disk β only then drop
it from the window.
Guarantees:
.forkmind/ (~/.forkmind-keys/); an accidentally committed
.forkmind/ leaks only ciphertext and structure.Mirror capsules to any number of extra filesystem targets (second disk, synced folder, network mount). Replicas hold ciphertext + manifests only β keys are never replicated. If the primary copy is lost or bit-rots, restore self-heals from the first replica that passes verification; healed copies get no trust shortcut (full integrity check still runs).
Forgetting reaches every copy: reachable replicas are shredded immediately;
a replica that was offline gets its stale ciphertext removed on the next
sync (tombstone propagation) β and it was unreadable anyway, since the
capsule key died at forget time. Tombstones also make heal refuse to
resurrect anything forgotten.
Move a capsule to another machine or project β a laptop that doesn't share
this project's ~/.forkmind-keys/ master key, a teammate, cold storage:
The bundle carries its own scrypt-derived key material (N=32768, deliberately slow to resist offline brute force of a weak passphrase) β it never depends on the source machine's master key, and the passphrase is never written into the bundle itself. On import, every segment is independently re-verified (recomputed id, recomputed hash, resolved parents, acyclic DFS) before anything touches disk β the bundle is never trusted blindly, only proven. Import is idempotent and honors tombstones, same as a fresh save.
The two halves connect: any conversation the proxy captured can be archived
into a capsule in one move β no manual JSON assembly β and restored later as
a provider-ready messages[] array, ready to splice into the next request:
Same via MCP: forkmind_context_save { fromNodeId } and
forkmind_context_restore { asMessages: true } β an agent can archive its own
captured history mid-task and splice it back whenever needed. Capsules keep
sourceNodeIds links back into the turn DAG.
forkmind context save and forkmind context stats report an estimated
token count freed from your context window (~4 bytes/token, the standard
rough heuristic) β a concrete number for how much a capsule actually saved.
Tweaking a system prompt or swapping a model can silently degrade results. ForkMind lets you pin a known-good captured node as a baseline, then re-run its exact request later and check the new output for drift.
Each case checks the replayed output against:
contains β substrings that must appearnot-contains β substrings that must NOT appearregex β patterns that must matchmin-similarity β Jaccard word-overlap vs the baseline (drift guard;
defaults to 0.3 so a wildly different answer fails even without explicit
assertions). LLM output is non-deterministic, so prefer assertions over exact
match.Cases are JSON in .forkmind/regressions/ β commit them to share baselines and
gate prompt changes in CI.
.forkmind/..forkmind/ layoutNode schema:
| Command | Does |
|---|---|
forkmind demo | Zero-setup showcase: sample DAG + dashboard in a temp dir |
forkmind init | Create .forkmind/ in the current directory |
forkmind start | Start the proxy (:4500) + serve the dashboard if built |
forkmind mcp | Start the stdio MCP server for agents |
forkmind regression pin/list/remove/run | Pin baselines and re-run to catch drift |
forkmind context save/list/show/verify/forget | Encrypted context capsules (see above) |
Env vars: FORKMIND_PORT, FORKMIND_HOST (default 127.0.0.1 β loopback
only; set 0.0.0.0 to expose on the LAN at your own risk),
FORKMIND_OPENAI_UPSTREAM, FORKMIND_ANTHROPIC_UPSTREAM, FORKMIND_PROXY
(SDK target base URL), FORKMIND_KEY_DIR (capsule master-key location,
default ~/.forkmind-keys).
Publishing is tag-driven via .github/workflows/release.yml (needs an
NPM_TOKEN repo secret with publish rights):
prepack rebuilds dashboard/dist so the tarball always ships the UI.
See CONTRIBUTING.md.
.forkmind/ historyforkmind demo β zero-setup sample DAG + dashboard, no API keyShowcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/forkmind)<a href="https://allmcps.com/mcp/forkmind"><img src="https://allmcps.com/api/badge/forkmind?style=directory" alt="Forkmind on AllMCPs" /></a>