Turnback
Click on "Deploy 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., "@Turnbackundo the last agent turn and show me the diff"
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.
Turnback
Turnback records file state before and during a coding agent's turn, then restores it through the CLI or MCP. The shadow Git repo lives in ~/.turnback (or TURNBACK_HOME), separate from the project's .git.
Supports Claude Code, Codex, Gemini CLI, Cursor, OpenCode, and Antigravity CLI. Requires Node.js 22+ and Git 2.25+. Claude Code, Codex, OpenCode, and Antigravity CLI have been tested live; Gemini CLI and Cursor are covered by tests built from their documented hook payloads.
npm install -g turnback
turnback install all --project
turnback list
turnback diff <turn-id>
turnback undo --dry-run
turnback undo --yesinstall all without --project installs the user-level config. uninstall all [--project] removes only Turnback entries. --no-mcp installs hooks without MCP. Other config is kept.
Available commands: install, uninstall, list, diff, status, restore, undo, redo, gc, and mcp. restore <turn> --path <file> --dry-run shows the plan. --yes applies it. redo --yes returns to the safety snapshot taken before the last restore. Restoring changes project files; the agent's conversation context is not restored.
Documentation: installation, restore, MCP, and scope.
How it works
The hook before a mutating tool takes the turn baseline. The hook before a shell command captures the whole tree; later edits capture the affected paths. The end of the turn captures the result. The initial snapshot is warmed in the background on install and session start. Hooks always let the agent continue when recording fails; a failed, skipped, or unprotected state is visible through status.
Tracked, untracked, and gitignored files up to 5 MB are covered. Build output and dependency directories are excluded. Extra rules use gitignore syntax in .turnbackignore; global rules go in ~/.turnback/config.json as {"exclude":["pattern"]}.
Workspaces above 100k files or 2 GB switch to edits-only mode: only paths touched by edit tools are snapshotted, shell commands are recorded as unprotected, and restore touches only recorded paths. Turns older than 7 days and outside the last 50 turns are cleaned up automatically, at most once a day.
Related MCP server: Rewindex
Development
Module | Contents |
| CLI and hook entry point |
| Each agent's hook payload → |
| Snapshot rules per event |
| Journal, snapshots, turn history, status, |
| Restore planning and execution, undo, redo |
| Shadow git repo wrapper |
| Workspace scanning and exclusion rules |
| JSONL journal, per-workspace lock, constants |
| Hook and MCP installation per agent |
| Stdio MCP server |
npm run check
npm run benchThe benchmark creates a temporary 10k-file repo and reports latency without making it a strict CI gate. CI runs the tests and benchmark on Windows, macOS, and Linux × Node 22/24.
From a clone, run npm ci && npm run build and use node dist/cli.js in place of turnback.
Releasing
Set the same version in package.json and in both version fields of server.json, commit, then push a v<version> tag. The Publish workflow checks that the versions match, runs the tests, publishes to npm through trusted publishing (provenance is attached automatically), and publishes server.json to the MCP registry as io.github.MFaizR77/turnback.
npm trusted publishing is configured on the package page at npmjs.com (repository MFaizR77/turnback, workflow publish.yml), which needs the package to exist. The first version is therefore published once by hand with npm publish --access public; pushing its tag afterwards skips npm (the version exists) and only publishes to the MCP registry. Later tags do both.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Git-backed platform for skills, tools, and context for AI agents
Shared memory for coding agents. Stop re-explaining your codebase every session.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Related MCP Servers
- AlicenseAqualityDmaintenanceA smart, checkpoint‑based undo system for Claude Code. Automatically snapshots file states before modifications, deduplicates unchanged checkpoints, and enables lightning‑fast restoration so you can experiment confidently with AI‑driven edits.513MIT
- FlicenseNot gradedqualityCmaintenanceAuto-snapshot tool for AI agents. Reduces the risk of AI agents breaking your code by automatically saving a snapshot of every file change locally. Rewind sessions, audit code changes, and inspect diffs directly from your AI chat or the built-in dashboard. Free and safe no cloud run local.1-

statecli-mcp-serverofficial
AlicenseNot gradedqualityDmaintenanceGives AI agents memory, undo, and self-awareness by tracking file changes and enabling checkpoints and rollbacks.72 npm2MIT- AlicenseNot gradedqualityDmaintenanceSyncs and manages configurations for dev tools like Claude Code and Gemini CLI across workspaces with snapshot history and rollback capabilities.Eclipse Public 2.0