agent-undo
Provides shadow Git checkpointing for local repositories, enabling snapshots of tracked and untracked files, checkpoint listing and diffing, restore/redo operations, and pruning without altering the real .git history.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Shadow Git snapshot and checkpoint time-machine for AI coding agents without touching your real .git history.
Works with Claude Code, Cursor, Windsurf, Codex CLI, and Antigravity.
When an autonomous coding agent rewrites ten files on top of your uncommitted changes and breaks the build, git checkout -- . wipes your own unsaved work too, while git reset --hard deletes new untracked files you wanted to keep.
agent-undo keeps an isolated bare Git object store in ~/.agent-undo/<repo-hash>.git outside the workspace. Every checkpoint captures tracked changes and new untracked files (honoring .gitignore) without adding a single commit to your real .git repository. Every restore takes an automatic pre-rewind snapshot first, so even an undo can be undone with redo.
Quick start
Requires Node.js >= 22.5.0 and git.
# Save a shadow checkpoint of your current working tree
npx -y github:keenfolk1-lgtm/agent-undo save "before auth refactor"
# List saved shadow checkpoints
npx -y github:keenfolk1-lgtm/agent-undo log
# Preview what restoring a checkpoint would change or delete
npx -y github:keenfolk1-lgtm/agent-undo undo <id> --dry-run
# Rewind to a checkpoint (saves pre-rewind first) and optionally redo
npx -y github:keenfolk1-lgtm/agent-undo undo <id>
npx -y github:keenfolk1-lgtm/agent-undo redoMCP server registration
claude mcp add agent-undo -- npx -y github:keenfolk1-lgtm/agent-undo serveOr add to mcp.json:
{
"mcpServers": {
"agent-undo": {
"command": "npx",
"args": ["-y", "github:keenfolk1-lgtm/agent-undo", "serve"]
}
}
}Automatic PreToolUse hook
Connect hooks/checkpoint-hook.mjs as a PreToolUse hook in Claude Code or Antigravity so a debounced shadow snapshot runs automatically before edit_file, write_file, Edit, Write, or Bash:
{
"hooks": {
"PreToolUse": [
{
"matcher": "edit_file|write_file|Edit|Write|MultiEdit|Bash",
"hooks": [{ "type": "command", "command": "node /path/to/agent-undo/hooks/checkpoint-hook.mjs" }]
}
]
}
}Related MCP server: statecli-mcp-server
Safety guarantees
agent-undo sets GIT_DIR and GIT_INDEX_FILE to ~/.agent-undo/<hash>.git, leaving <workspace>/.git and its index untouched. .gitignore rules are honored, binary/archive build artifacts (.exe, .apk, .dmg, .zip, .db) and files over 10 MB are skipped automatically, and unsafe targets (home directory, filesystem root, .gemini/config) are blocked.
MCP tools
Tool | Purpose |
| Creates a shadow tree commit if working tree bytes changed since the previous checkpoint. |
| Lists checkpoint IDs, ISO timestamps, and labels. |
| Shows |
| Rewinds all files or a |
| Restores the latest automatic |
| Keeps the latest N checkpoints and runs |
Limitations
Checkpoints store snapshots of non-ignored text and binary files inside ~/.agent-undo/, which consumes local disk space proportional to changed objects until prune runs. Files outside the workspace root or ignored via .gitignore (such as .env or node_modules) are intentionally skipped by snapshots and untouched on restore.
License
Related tools: mcp-diet · skill-guard · blast-radius-mcp · flight-recorder-mcp · de-slop
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Git-backed platform for skills, tools, and context for AI agents
Plain-English git for agents: 22 tools to branch, commit, push and tag. Free tier.
Git collaboration for AI agents and people: tasks, hand-offs, reviews, teams, shared memory.
Evidence-backed project memory and checkpoints for AI coding agents.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides AI assistants with secure, read-only access to ShadowGit repositories for debugging and code analysis. Enables powerful analysis of fine-grained git history captured automatically by ShadowGit's continuous commit tracking.1350MIT

statecli-mcp-serverofficial
AlicenseNot gradedqualityDmaintenanceGives AI agents memory, undo, and self-awareness by tracking file changes and enabling checkpoints and rollbacks.83 npm2MIT- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to checkpoint workspace state, branch parallel attempts, inspect diffs, and roll back to known-good states mid-task through MCP tools, with automatic safety checkpoints to prevent data loss.6 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to checkpoint, diff, search, branch, merge, and restore intermediate states of pending Perforce changelists without submitting them. Each snapshot is stored as a local Git commit outside the Perforce workspace, so agents can commit milestones automatically and roll files back to earlier revisions.MIT