For coding agents · Claude Code & Codex

Durable work that survives sessions

Coding agents lose everything between sessions: the objective, the plan, the attempt that failed and why. MindGraph is the graph-managed substrate underneath the loop. Your agent's tasks, iterations, blockers, and lessons become durable, code-anchored state, and a deterministic brief lets any fresh session resume exactly where the last one stopped.

One command
npx -y mindgraph-mcp install-code --api-key mg_your_key --hooks

The cross-session test, passed live

This is the product's defining acceptance run: two real Claude Code sessions, one piece of work, zero shared context.

1

Session A hits a wall

Your agent creates a task, plans two steps, and runs an iteration. The test fails. It records the failure, the exact next action, and blocks the task with a reason. Then the session ends, or crashes. It doesn't matter which.

2

Session B picks it up cold

A fresh session with no transcript, no copied prompt, maybe on a different machine, receives one bounded work brief at start: the task, the blocker, iteration 1's failure, the recommended next action, and the exact version + lease needed to continue. It fixes the code, checkpoints a passing iteration, completes the task, and captures the lesson.

3

Session C sees finished work

Nothing is active to resume, but the full history is queryable: which attempts failed and why, what the fix was, and the lesson, anchored to the exact function it's about.

Three things nothing else combines

Code-grounded memory

Functions, files, and routes become identity-stable graph entities. Lessons, decisions, and risks anchor to the code they're about, and they survive refactors because identity is the symbol, not the line number. Live callers/impact comes from your local codegraph index, federated at query time, never mirrored.

Graph-managed work

Goal → Project → Task → Plan → Step → Execution, with validated state machines, fenced leases (a stale writer gets a typed 409, never a silent overwrite), idempotent iterations, and poison-task escalation after repeated failures.

Deliberate, governed memory

No transcript scraping, no background extraction. The agent writes memory in visible tool calls, stamped with verified session/repo/commit provenance by the hook layer. A reflection checkpoint prompts once before a substantial session ends uncaptured.

Measured, not promised

20/20

correct work selection across the scripted resume matrix. Deterministic, never embedding-ranked

133ms

p95 SessionStart brief injection against a local server

~2k

tokens for the largest work brief, bounded, with explicit truncation flags

0

duplicate identities under a 20-way concurrent anchor race

What the hooks actually do

SessionStart

opens or rebinds your session and injects the current work brief, including crash recovery via lease takeover when a previous session died mid-iteration.

PreToolUse

stamps every MindGraph call with verified session, repo, branch, and commit provenance. Your model's arguments are never overwritten. Forged context is.

Stop

one reflection checkpoint per session: if substantial work is uncheckpointed, the agent is prompted once to checkpoint, capture a lesson, or say nothing durable changed.

SessionEnd

cleanup only. Correctness never depends on it firing; crashed sessions recover at the next SessionStart.

The honest fine print

  • The work substrate needs a current MindGraph server (Cloud has it; self-hosted builds from main).
  • codegraph is optional. Without it, memory and work tools function fully, and code anchoring degrades to typed unavailable results instead of failing silently.
  • Codex gets the full tool surface today via MCP. Automatic session hooks for Codex are planned.
  • Hooks fail open, always: if MindGraph is unreachable, your coding session is never blocked.
  • Teams share one org graph. Anchored knowledge converges across clones; give each member --agent-id claude-code:<name> so leases and briefs stay per-person. The install command in your dashboard does this for you.

Give your agent a memory worth resuming