SuperAPI AI Directory

mulligan

mulligan is a free, open-source command-line tool that gives coding agents an “undo” capability. It snapshots project files at every prompt, tool call, and end of turn, so file modifications made by an agent through editing tools, shell commands, code generators, or formatters are recorded. Users can view the timeline with mulligan list, view diffs with mulligan diff, restore files to any snapshot point with mulligan undo, and the undo operation itself can also be undone. Snapshots are stored in a separate git repository outside the project and never touch the user's own git repository, history, index, staging area, or hooks. The tool supports Codex, Claude Code, Gemini CLI, OpenCode, Cursor, Copilot CLI, Aider, and others, and can adapt to agents without hooks via mulligan run -- <agent>. It runs entirely locally, with no network access and no telemetry, requires only git 2.25+, and supports macOS 13+ and Linux x86_64/ARM64.

Open website

About this tool

mulligan is an undo tool for coding agents, provided as a command-line tool. Its core purpose is to address unexpected changes that agents may make while modifying a project, especially shell command changes that the agent's own undo functionality cannot cover.

Main capabilities include: automatically snapshotting project files at every prompt, tool call, and end of turn; viewing the timeline with mulligan list, viewing diffs between any two points with mulligan diff, restoring to any snapshot point with mulligan undo, with redo support; restoring only a single file or folder; storing snapshots in a separate git repository outside the project without touching the user's repository; capturing file changes caused by shell commands; skipping files over 10MB, sockets, pipes, nested repositories, and submodules; a default limit of 500 snapshots, 30 days, and 2GB per project, configurable; no network access or telemetry, prompt content is stored locally only by default and can be disabled.

Usage: download the binary to ~/.local/bin via the install script, or build from source (requires Swift 6.1+). Use mulligan setup <agent> to get agent configuration instructions; mulligan does not automatically edit configuration files. For agents without hooks, use mulligan run -- <agent>. In folders without git, run mulligan init first.

Use cases: developers using coding agents such as Codex, Claude Code, Gemini CLI, OpenCode, Cursor, Copilot CLI, and Aider who need to safely undo changes made by the agent and its shell commands.

Limitations: Windows is not currently supported; requires git 2.25+; macOS requires 13+; Linux requires x86_64 or ARM64; does not back up ignored files, oversized files, or nested repositories; it is not a backup tool, and keeping commit and backup habits is recommended.