Save a checkpoint of the whole project before the agent starts, read its edits in the file as they land, then restore the project or one file if you don't want them. Flywrite saves that checkpoint when Claude Code starts, and when Cursor Agent starts after its one-time setup. Before Codex or any other CLI agent, press ⌘⇧C.
We make Flywrite, the Markdown writing app these steps use.
What you'll need
- A Mac: Flywrite is a Mac app.
- Flywrite, with your drafts opened as a project, which is an ordinary folder of files (Your first project).
- A CLI agent that already runs in your Mac's terminal: Claude Code, Codex, Cursor Agent or another. If it runs there, it runs in Flywrite's terminal.
- For Cursor Agent, its one-time setup in Settings → Agents (Writing with Cursor).
Do it step by step
By the end, every agent run starts from a checkpoint (saved for you when Claude Code or Cursor Agent starts, one keystroke for the rest), and you can roll back what the agent changed for the whole project or one file.
-
Check that checkpoints are on. In Settings → Writing, keep Turn on checkpoints for new projects on, and leave the automatic checkpoint for agents on there too. One project can override it with Checkpoints (version history) in its Project Settings, and a folder that already has a Git repository keeps its checkpoints either way.
Settings → Writing Project Settings → CheckpointsYou should see the Checkpoint button in the top bar and the Versions panel below the file tree. With checkpoints off, both step aside.
-
Start the agent from a checkpoint. Flywrite saves a checkpoint of the whole project when Claude Code starts in its terminal, and when Cursor Agent starts after its one-time setup. Codex and other CLI agents don't trigger it, so press
⌘⇧Cbefore you start them. For Codex, that's two keystrokes (these are Flywrite's default shortcuts; every one is customizable):⌘⇧C Checkpoint Now ⌃3 Start CodexYou should see the new checkpoint at the top of the Versions panel (
⌘⇧V), which lists checkpoints newest first. -
Read each edit as it lands. Keep the draft open while the agent works: it edits the file directly and the editor updates live. Current versions of Claude Code start a terminal session in auto mode, which edits without stopping to ask. To approve each edit before it lands, press
Shift+Tabin Claude Code to switch to Manual mode, or start it in Manual mode from a plain terminal tab (⌃1):claude --permission-mode manualYou should see Claude Code stop and ask you before it edits a file.
-
Restore the whole project, or one file. Open Versions and expand the checkpoint from before the agent ran. Restoring the whole project saves a safety checkpoint of the current state first, so even a restore can be undone.
⌘⇧V, then expand a checkpoint: Restore project to this point Restore (on one file)You should see the project, or that one file, back as it was at that checkpoint.
-
Or rewind inside Claude Code. Claude Code keeps its own checkpoint for each prompt you send, in Flywrite's terminal as anywhere else. Run
/rewind, or pressEsctwice with the prompt empty. It restores files Claude Code's edit tools changed; a file that only shell commands changed isn't tracked, so restore that one from Versions./rewindYou should see Claude Code's rewind menu, with the points you can go back to.
-
Ask the agent for a line-by-line list (optional). Flywrite restores from checkpoints; it doesn't show a diff. The Codex CLI docs list no undo command and advise Git checkpoints instead. A Flywrite checkpoint is a Git commit, so Codex's own
/diffcommand shows the Git diff since your latest checkpoint, including new files. In a project connected to GitHub, checkpoint names in Versions link to their commits on github.com, where you can select a file to view its diff./diffYou should see the Git diff of the project in the Codex terminal.
When not to use this
- You want to keep or undo each agent edit inline. Flashtype, a free Markdown editor for Claude Code and Codex, shows agent edits inline with keep or undo for each change (Flashtype). Flywrite rolls back from checkpoints instead.
- Your drafts live in a cloud document editor. Use that editor's own version history. Flywrite's checkpoints cover the files in a project folder on your Mac (Your first project).
- You need a copy off your computer. Checkpoints stay on your Mac. Connect the project to GitHub for a backup (Backup & sync with GitHub). Step by step: Back up Markdown projects to GitHub.
- You only run Claude Code, outside Flywrite. Use
/rewindfor files its edit tools changed, and commit to Git yourself for the rest.
Flywrite is $99 a year for Mac, with no AI fee. Read about checkpoints.
Buy nowQuestions
Does Flywrite save a checkpoint before every agent?
No. It saves one when Claude Code starts in its terminal, and when Cursor Agent starts after its one-time setup. Codex and other CLI agents don't trigger it, so press ⌘⇧C before you start them.
Is a checkpoint a backup?
Not on its own. A checkpoint is a Git commit that stays on your computer. For a copy off your computer, connect the project to GitHub and Sync.
Do I need to know Git?
No. Flywrite saves and restores checkpoints with a button or a shortcut, and you never type a git command. GitHub backup is one Sync action, also with no git commands.
- Flywrite docs: Checkpoints & versions. Checked .
- Flywrite docs: Writing with Claude Code. Checked .
- Flywrite docs: Writing with Codex. Checked .
- Flywrite docs: Writing with Cursor. Checked .
- Flywrite docs: The terminal. Checked .
- Flywrite docs: Keyboard shortcuts. Checked .
- Flywrite docs: GitHub backup & sync. Checked .
- Flywrite docs: Your first project. Checked .
- Flywrite pricing. Checked .
- Claude Code: Checkpointing. Checked .
- Claude Code: Choose a permission mode. Checked .
- OpenAI Codex docs: Developer commands (CLI). Checked .
- OpenAI Codex docs: Codex CLI. Checked .
- GitHub Docs: Commits. Checked .
- Flashtype. Checked .