Black Friday sale: 30% off Flywrite
The short version

Open your folder of Markdown drafts in Flywrite and run Claude Code, Codex or another CLI agent in the terminal under the page. Save a checkpoint first. When the agent changes the file you have open, the page updates and you keep your place. If you have unsaved edits, nothing is overwritten: you choose which version to keep.

We make Flywrite, the Markdown writing app these steps use. The steps follow Flywrite's app and each agent's own docs, listed under Sources.

What you'll need

  • A Mac with Flywrite, and your drafts as Markdown files in one folder.
  • A CLI agent on your own plan, such as Claude Code or Codex. If it runs in your Mac's terminal, it runs in Flywrite's, with no Flywrite AI fee (which plan you need).

Do it step by step

  1. Open the folder in Flywrite. Click + in the projects rail and choose Open Folder. Your drafts stay plain Markdown files, so you and the agent work on the same files (Open or create a project).

  2. Save a checkpoint before the agent starts. 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 ⌘⇧C before you start them. The checkpoint keeps every file as last saved, your own edits included.

  3. Give the agent one file or one section. Press ⌃2 for Claude Code or ⌃3 for Codex, then say where it works and what to leave alone:

    Tighten the intro of issue-43.md. Leave the rest alone.
  4. Keep writing. Work in another file, or another part of the same one. When the agent changes the file you have open, the page updates in place, and your cursor, selection and scroll stay where they were.

  5. Let your edits save. Flywrite saves 2 seconds after you stop typing, and ⌘S saves at once. If the agent changed the file since Flywrite loaded it, Flywrite asks you instead of saving over it.

  6. If the banner appears, choose a version. When the agent changes a file while you have unsaved edits in it, Flywrite shows "This file changed on disk while you have unsaved edits." Click Reload (discard my edits) to take the agent's version, or Keep mine (overwrite) to write yours over it. To keep some of both, copy your new sentences, reload, then paste them back.

  7. Tell the agent what you changed. Claude Code edits against the file as it is now, and reads it again before edits that depend on text you changed. With Codex, say what you edited and ask it to read the file again:

    I edited paragraph 2 of issue-43.md. Read it again first.
  8. Roll back from the checkpoint if you need to. Open Versions (⌘⇧V), expand the checkpoint from before the agent started, and restore the project or one file. Flywrite saves a checkpoint before it restores, so you can undo the restore too. Claude Code's own rewind normally leaves out changes you typed yourself, so use Flywrite's checkpoint when you both edited a file. More in Roll back what an AI agent changed.

Facts at a glance

Fact Detail
Where your drafts live Plain Markdown files in a folder on your Mac
The agent edits your open file The page updates in place and keeps your cursor and scroll
When Flywrite saves 2 seconds after you stop typing, or at once with ⌘S
What a save never does Write over a file that changed on disk since Flywrite last loaded it
The agent edits a file you haven't saved A banner: Reload (discard my edits) or Keep mine (overwrite)
Checkpoint when the agent starts Claude Code: yes. Cursor Agent: after its setup. Codex and other agents: press ⌘⇧C
Claude Code's rewind Normally leaves out changes you typed yourself
Price $99 a year, with no AI fee

When not to use this

  • Someone else edits the drafts on another Mac. Back the project up to GitHub and Sync, and Flywrite shows both versions when edits clash (Sync a writing project between two Macs).
  • You want the agent on its own copy of the files. Codex's best practices list running a task on the same files without a Git worktree, a second working copy of the project, as a common mistake. Ask your agent to set one up, and to merge back what you keep.
  • Your drafts live in a cloud document editor. CLI agents work on files on your computer. Copy the draft into a Markdown file first, or keep it where it is and use that editor's version history.
Write in the file while your agent works on it

Flywrite is $99 a year for Mac, with no AI fee. Read about the editor.

Buy now
Sources
  1. Flywrite docs: Write and format in the editor. Checked .
  2. Flywrite release notes. Checked .
  3. Flywrite docs: Open or create a project. Checked .
  4. Flywrite docs: Undo changes with checkpoints. Checked .
  5. Flywrite docs: Write with Claude Code. Checked .
  6. Flywrite docs: Write with Codex. Checked .
  7. Flywrite docs: Use the terminal under the page. Checked .
  8. Flywrite docs: Keyboard shortcuts. Checked .
  9. Flywrite pricing. Checked .
  10. Claude Code: Tools reference. Checked .
  11. Claude Code: Checkpointing. Checked .
  12. OpenAI Codex docs: Codex CLI. Checked .
  13. OpenAI Codex docs: Best practices. Checked .

Write with your agent in a writing app.

Buy now