← Back to Discover

stepback

A command-line wrapper that checkpoints your files while an AI coding agent works, so you can rewind the working tree, and on a best-effort basis the conversation, without touching your git branch.

Command-line tools

What it does

StepBack sits beside an AI coding agent such as Claude Code, Codex or aider, or any command that edits files. You start the agent through it, and it snapshots the working directory each time a burst of edits settles. If the agent makes a mess, you list the checkpoints, preview a diff and rewind to the one you want. Checkpoints are stored as git objects in their own reference namespace using a separate index, so your branch, HEAD, staging area and commit history are not modified. Rewinds reproduce the tree exactly, can be limited to chosen paths, ask for confirmation first, and can themselves be undone with a redo command. Outside a git repository it keeps a private object store instead. For Claude Code and Codex it can also save and restore the agent's on-disk session and print a command to resume it. The project says this part is best-effort because those session formats are private and can change, and that you still get the file rewind if it fails. Files ignored by git, such as build output and .env, are not captured. It installs with pip and needs Python 3.11 or newer and git.

Capabilities

  • Works with Claude Code, Codex, aider or any command that edits files
  • Checkpoints after each settled burst of edits, kept apart from your git history
  • Diff preview, dry run, path-limited restore and redo for rewinds
  • Best-effort conversation rewind for Claude Code and Codex
  • Write-ahead journal so an interrupted restore can be recovered

When to use it

  • An agent has left half-broken edits across several files and nothing was committed, so git stash cannot help
  • You want to undo an agent's last turn without touching your branch or staging area
  • You use more than one coding agent and want a single rewind tool for all of them