Annotate AI-Generated Markdown on a Mac

Annotations are a red pen for AI-generated Markdown. Select rendered text in the preview and mark it up with strikes, locks, comments, notes, and block instructions, then export your annotations as a structured prompt you can paste straight back into Claude Code, ChatGPT, or any other AI assistant.

Annotations work in viewer mode only. Enter edit mode to make changes yourself, or use annotations to describe what an AI tool should change.

Annotation Types

There are five annotation types:

  • Strike — Select text and click Strike on the floating toolbar, or press S. Marks the text for deletion with a red strikethrough. Use this when text should be removed entirely.
  • Lock — Select text and click Lock on the floating toolbar, or press L. Highlights the text in green to protect it from changes. Use this when text should remain exactly as-is.
  • Comment — Select text and click Comment on the floating toolbar, or press C, then type your suggestion. Highlights the text in amber with your editing instruction attached. Use this when text should be rewritten or changed.
  • Note — Add a document-level note with ⇧⌘N. Notes are not tied to specific text. Use this for general instructions like "add a conclusion section" or "change the tone to be more formal."
  • Block Note — Press ⇧⌘B to enter block note mode. Block-level elements (paragraphs, headings, lists, code blocks) become selectable. Click a block, then type an instruction about the surrounding text. Use this to give AI tools block-level directions.

When you select text in the preview, a floating toolbar appears with buttons for Strike, Lock, Comment, and Delete. You can also use keyboard shortcuts while the toolbar is visible: S for strike, L for lock, C for comment, X to delete the annotation.

A text annotation can span several paragraphs, list items, or headings. Drag across everything you want to mark and press the button once; each paragraph gets its own highlight, and they are removed together. If Peekdown can't place a selection at all, the toolbar buttons dim and a note says so.

Annotation Toolbar

Toggle the annotation toolbar with ⇧⌘A or the Annotations button in the title bar; closing it also closes the document note, unless you've dragged the note into its own window. The toolbar is an inline strip that slides down below the window title bar with buttons for the document note, block note, copy/export, and delete all. The Annotations button displays a badge with the total annotation count.

The document note is where you type instructions that aren't tied to specific text. Click the note button in the annotation toolbar or press ⇧⌘N to open or close it. It opens below the note button. When the annotation toolbar is hidden, ⇧⌘N opens the toolbar too. The note saves as you type. To close it, press Return or Esc, or click anywhere outside it. To start a new line, hold Option and press Return.

To keep the note on screen while you mark up the document, drag it away. It becomes a small window of its own. It moves with the document's window and hides while another tab is in front. Close it with its close button, or click in it and press Return, Esc, or ⌘W.

Copying Annotations

Press ⌥⇧⌘C to copy your annotations. Peekdown copies a structured prompt to your clipboard that includes all your annotations formatted for AI assistants. The format uses a JSON array where each annotation has a type field (delete, lock, comment, note, or blocknote) with before and after context fields so AI assistants can locate and parse the exact text.

Paste the prompt into whichever AI you use — Claude Code, Cursor, ChatGPT, Claude.ai, or any other assistant. In a terminal, pbpaste | claude (or your tool's equivalent) pipes the clipboard straight into the conversation.

After copying, Peekdown clears the annotations from your document so the AI's response can be applied to a clean version. If you change your mind — say the AI's edit isn't what you wanted — press ⌥⇧⌘Z, choose Annotations > Restore Annotations, or click the Restore button in the annotation toolbar to bring your annotations back. The snapshot persists across restarts and survives closing the file, so you can restore even days later. Each Copy creates a new snapshot, replacing the previous one.

Restore is automatically discarded once the document changes. If your AI assistant applies the edits and saves the file (or you edit it yourself), the snapshot no longer matches the document and Peekdown discards it — the Restore button disappears and the menu item becomes disabled. This is intentional: restoring annotations onto modified text would put them in the wrong place. If you want a permanent backup of your annotations regardless of what happens to the document, export them first via Annotations > Export Annotations (⌥⇧⌘E) — that writes a .json file next to your document that you can re-import any time, even after the document has been edited.

Sending Annotations to AI

Claude Desktop, Claude Code, Cursor, and Codex can take your annotations straight from Peekdown, with nothing to copy or paste. Connect the app first in Settings > AI.

There are two ways to hand them over:

  • Ask for them. Mark up the document, then ask the app to apply your Peekdown annotations. It takes them from the document in front in Peekdown, or from the one you name, and edits the file on disk.
  • Send them. Ask the app to wait for your Peekdown annotations. When you're done marking up, click Send to AI next to Copy on the annotation toolbar, choose Annotations > Send Annotations to AI, or press ⌥⇧⌘S. While an app is waiting, the button switches between two icons, and the Annotations button in the title bar switches between the highlighter and sparkles, so you can tell an app is waiting while the annotation toolbar is closed. On both buttons the sparkles are pink, and holding the pointer over the Annotations button shows "An AI app is waiting for your annotations". With Reduce motion on, both buttons show the sparkles in that color without moving. If you press Send in the moment between two of the app's checks, the button spins until it checks again, for up to 10 seconds.

Either way, Peekdown clears the annotations it hands over, the same as Copy, and closes the annotation toolbar. When you send them, a brief Annotations sent to AI notice confirms the app has them. Your clipboard isn't touched. ⌥⇧⌘Z, Annotations > Restore Annotations, or the Restore button brings them back, with the same limits as after Copy: only the last set cleared from that document comes back, and only until the document changes. Once the app has saved its edits, File > Show Changes… shows what it changed. An app can also read your annotations without clearing them, if you ask it to only look.

If no app is waiting when you press Send, Peekdown says so and leaves your annotations alone.

When Claude Code or Codex asks for approval to wait for your annotations, choose to always allow it, or it asks again every time it checks.

Send is dimmed when the document:

  • hasn't been saved to a file yet
  • is in edit mode
  • has unsaved changes
  • has no annotations

An app that asks for annotations in those cases is told why, and nothing is cleared.

An app can also see which closed documents still have saved annotations. It has to open one in Peekdown before it can take them, and Peekdown tells it how.

Persistence

Annotations are automatically saved to the app's storage at ~/Library/Application Support/Peekdown/annotations/. When you reopen a file, its annotations are restored automatically. When you switch to a different file with unexported annotations, Peekdown shows a reminder that your annotations are saved and will be restored when you return.

Import & Export Files

You can export annotations to and import them from standard JSON files using the Annotations menu.

Export Annotations (Annotations > Export Annotations) saves a .json file alongside your document. The naming convention is filename.json — for example, annotations for notes.md are saved as notes.json. The file is a standard JSON file, visible in Finder, that you can share with collaborators or back up alongside your documents.

Import Annotations (Annotations > Import Annotations) opens a file picker for .json annotation files. You can also drag and drop a .json annotation file directly onto the Peekdown window to import it. When you import annotations, they are saved to Peekdown's internal storage. From that point on, the annotations persist in Peekdown automatically — you don't need to keep the JSON file. If you close and reopen the document later, your imported annotations will still be there.

File Format

Annotation files use JSON with the following schema:

{
  "annotations": [
    {
      "id": 1,
      "type": "strike",
      "text": "text to delete",
      "contextBefore": "preceding context",
      "contextAfter": "following context"
    },
    {
      "id": 2,
      "type": "lock",
      "text": "text to preserve",
      "contextBefore": "...",
      "contextAfter": "..."
    },
    {
      "id": 3,
      "type": "comment",
      "text": "text to change",
      "comment": "editing instruction",
      "contextBefore": "...",
      "contextAfter": "..."
    },
    {
      "id": 4,
      "type": "note",
      "text": "document-level instruction"
    },
    {
      "id": 5,
      "type": "blocknote",
      "text": "instruction for this block",
      "blockText": "the block this note applies to",
      "contextBefore": "...",
      "contextAfter": "..."
    }
  ],
  "nextId": 6,
  "hasUnexported": false,
  "exportedContentHash": "sha256-hex-string"
}

The type field must be one of: strike, lock, comment, note, or blocknote. The contextBefore and contextAfter fields anchor annotations to surrounding text so they survive minor edits. The exportedContentHash lets Peekdown detect when the document has been updated by an AI tool after export.

For a full walkthrough of building this into an AI coding workflow — triage, file watching, and the copy-paste loop with Claude Code or ChatGPT — read How to Annotate AI-Generated Markdown on a Mac.