SuperAPIAI Directory

agentckpt

github.com · AI coding

agentckpt is a command-line tool for coding agents (such as Codex, Claude Code, Gemini CLI, OpenCode, Cursor agents) that snapshots (checkpoints) the working tree while the agent is running and can restore any snapshot without touching the real git branch or index. It maintains a private shadow store .agentckpt/ under the project, supports snapshots and restores that include untracked files, respects .gitignore, uses content-addressed deduplicated storage, and provides watch for automatic snapshots, prune for cleanup, doctor for diagnostics, and hook integration.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

agentckpt is a command-line tool for creating checkpoints (snapshots) of the working tree while a coding agent is running, and restoring any snapshot when needed, without touching the real git branch or index.

Purpose: coding agents (Codex, Claude Code, Gemini CLI, OpenCode, Cursor agents, etc.) edit and delete files, and the built-in /undo is often missing or unreliable. agentckpt maintains a private shadow store .agentckpt/ under the project, letting users freely snapshot (including untracked files) and restore, and never runs git add / git commit or moves branches in the real .git.

Key capabilities:

  • Snapshot and restore the working tree without touching git branches or the index.
  • Storage is content-addressed, and unchanged files are deduplicated. Officially measured on a psf/requests clone: about 4.2 MB after the first snapshot, and about 9.4 MB after 200 snapshots (about 27 KB each).
  • Files larger than 10 MiB are skipped (--max-bytes).
  • agentckpt prune --keep N (default 50) cleans up old snapshots.
  • Respects .gitignore, so build/, node_modules/, .venv/, etc. are not stored; specific ignored paths can be captured via include_ignored; committed files can be excluded from snapshots via .agentckptignore (.gitignore syntax, affects snapshots only).
  • Ignored .env or generated config files do not have their contents stored by default; each snapshot records only metadata (path, size, mtime, hash), and a warning is issued on restore if these files have changed or are missing; opting in requires include_ignored, and suspected secret files also require allow_secrets = true, and are stored unencrypted (released in v0.3.0).

Usage:

  • Zero Python dependencies, requires Python 3.9+, and requires git in PATH; wheel packages are available on the releases page.
  • Automatic snapshots: agentckpt watch .
  • Cleanup: agentckpt prune --keep 50
  • Diagnostics:agentckpt doctor
  • Hook integration: have the agent create checkpoints before each prompt, before each edit or shell command, and after each turn. All configurations call agentckpt hook, which reads the hook JSON (last argument or stdin), finds the project based on cwd, and creates a snapshot with a message like claude: before Edit src/app.py; it always exits with 0 and outputs nothing to stdout, so it never blocks prompts or rejects tool calls.
  • Ready-to-use configurations for Codex (notify + hooks.json), Claude Code, Gemini CLI, and the OpenCode plugin are provided in examples/; other tools can use agentckpt run -- aider .; projects that have not run agentckpt init are skipped.

Use cases: developers who need reliable rollback points when using coding agents for file edits and deletions, without polluting git branches or the index.

Limitations: requires Python 3.9+ and git; files larger than 10 MiB are skipped; paths in .gitignore are not stored by default; ignored files record only metadata by default; secret-like files must be explicitly allowed and are stored unencrypted; uninitialized projects are skipped.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools