Related ToolsClaude CodeCursorAiderCodeanywhere

Ckpt Adds Git-Based Checkpoints and Branching to AI Coding Sessions

AI news: Ckpt Adds Git-Based Checkpoints and Branching to AI Coding Sessions

Here's a scenario every AI-assisted developer knows: your coding agent makes 15 rapid edits across 8 files, something breaks, and now you're stuck. You can undo everything and lose 14 good changes, or you can manually hunt through diffs to find the one bad edit. Either way, you just burned 10 minutes on a problem that shouldn't exist.

Ckpt ("checkpoint") is a new open-source CLI tool that solves this by creating automatic snapshots during AI coding sessions. It layers on top of Git, creating a hidden branch where each snapshot becomes a real commit. When something goes wrong, you roll back to the exact step before the break - not the whole session.

How It Works

The core commands are straightforward:

  • ckpt watch starts auto-snapshotting whenever files change
  • ckpt snap "added auth logic" creates a manual checkpoint with a note
  • ckpt restore 5 rolls back to step 5
  • ckpt try alt-approach -r 3 branches from step 3 to try a different direction
  • ckpt trydiff alt-approach compares your branches side by side
  • ckpt end -m "feature complete" squashes the whole session into one clean Git commit

Under the hood, ckpt start creates a hidden Git branch (ckpt/session/<id>). Restoring uses git reset --hard for near-instant rollback. Session history persists in a .ckpt/history/ directory.

Terminal Agents Need This Most

Cursor and similar IDE-based tools have some built-in checkpoint features, but they're mouse-driven UI elements that the AI agent itself can't operate. Ckpt runs in the terminal, which means agents like Claude Code, Aider, and OpenAI Codex can execute checkpoint commands directly as part of their workflow. The agent can snapshot its own work, try alternatives, and roll back without human intervention.

The project is early-stage (MIT license, 5 commits, available via npm install -g @mohshomis/ckpt), but the concept addresses a real gap. The developers claim error recovery drops from 30-60 seconds and hundreds of tokens down to milliseconds. Even if the actual improvement is half that, it's a meaningful quality-of-life fix for anyone doing extended AI coding sessions.