File Preview

  • Desktop, mobile and web
  • All plans

What it does

One preview window for every file the app shows you: a file in the Files tab, a changed file in the Changes tab, an attachment in the composer, a result of the command palette, a path clicked in a terminal. Deliverables open rendered rather than as source: Markdown as a document, an HTML report in a sandboxed frame, a CSV or TSV as a table, a PDF in the built-in viewer, images, video, audio, fonts and SVG as media. Code opens in an editor you can save from. Arrow keys move to the previous or next file of the list you came from without closing the preview. The same window also opens any file of the disk, even one outside the project (a log, a dotfile, a snippet in another folder), through File > Open File… or Cmd O / Ctrl O.

Where to find it

  • Right panel > Files: click a file. Right panel > Changes: click a changed file (diff or raw, as filtered).
  • Composer attachments tray: click an attached file.
  • Command palette (Cmd K / Ctrl K): a file (/) or commit (:) result opens as a peek above the palette.
  • A file path in a terminal, and the session information panel.
  • Menu bar > File > Open File… (Cmd O on macOS, Ctrl O on Windows and Linux): the system file picker, over the whole disk, hidden files shown. Works from anywhere in the app, including the projects home, the settings and the Open space.

How to use it

  1. Open a file. Rendered formats show a Preview / Source toggle in the header ("Show raw source" / "Show rendered preview"). Binary files show "Binary file: this file cannot be displayed as text".
  2. Navigate: Previous file (←) and Next file (→), with a 3/7 counter; the list wraps at both ends. The list is the one you came from: the tray's attachments, the Changes list as filtered, the search results or the current folder of the file browser. An isolated preview (palette, terminal link) shows no arrows.
  3. Edit: Edit file, type, Save (⌘S); closing with unsaved changes asks "Discard unsaved changes?". While the cursor is in an editor, the arrows move the cursor, not the file.
  4. Header actions: Copy content, Copy path, Show in folder, Download, Expand to full window / Restore default size, Read this document aloud, and for images Annotate ("Annotate this image in the sketch canvas").
  5. CSV: the separator (comma, semicolon, tab, pipe) is detected on the first line; a summary shows rows × columns.
  6. Expand: Expand to full window lifts the reading column of a Markdown file so wide code blocks and tables use the whole window; Restore default size brings the column back. The choice is remembered on this machine from one opening to the next.
  7. Search inside the file: press Cmd F (macOS) or Ctrl F (Windows, Linux), or click the magnifier in the header (Find in file). The search panel opens on the source with Find, next / previous / all, match case, regexp, whole word, and a live counter such as 3 of 12 (No results when nothing matches). Enter and Shift+Enter walk the matches, Escape closes the panel before the window. A rendered Markdown, HTML or CSV view switches to Source first. To replace, press Ctrl H (Windows, Linux) or Cmd Alt F (macOS): the file enters edit mode and the panel gains Replace, replace and replace all; save afterwards as usual.
  8. Open any file: File > Open File… (or Cmd O / Ctrl O), pick a file in the system picker. To type a path instead of browsing, use the picker's own shortcut (Cmd Shift G on macOS, / or ~ in the GTK picker on Linux). The file opens in the same preview, with rendering, source, editing and saving. When it sits outside the open project, the header shows an Outside the project badge with its full path ("This file is not part of the open project. Its full path is shown, and saving writes to that file on disk."). The same badge appears on any external file the preview shows, such as a screenshot dropped from Downloads or a CLI transcript.

Settings

None.

Agent tools (MCP)

None. Agents read files with their own tools; the preview is a surface for the user.

Providers

All providers, no difference.

Mobile

Partly. The phone has a code viewer in the file explorer, a diff viewer in the Changes screen, and a shared image viewer for ticket attachments, chat images and generated media. Previous / next navigation exists there too, with the same chevrons and counter, plus a horizontal swipe on images and media (not on code, where the gesture would fight text selection). Long lines wrap in the code viewer, as on the desktop; a file opened from the conversation no longer shows a blank page. Tapping a file path in an agent's console looks in that agent's worktree first, so the file the agent just wrote opens rather than the stale copy in the main checkout. HTML rendering, the CSV table, Open File… and the in-file find and replace are not on the phone: the companion only reads files of the project through the desktop.

Limits

  • The CSV table shows the first 2000 rows; beyond that a banner sends you to the Source view, which handles large files.
  • The HTML frame runs the document's own scripts (reports need them for their charts) but in an opaque origin: no access to the app, its storage or other local files; alert() dialogs are blocked so a page cannot freeze the window.
  • Relative resources of an HTML file (./chart.png, ./style.css) resolve against the file's folder.
  • A held arrow key moves one file per press: each step reads a file or runs a diff.
  • Windows and POSIX paths are both handled.
  • A file opened with Open File… stays outside the project: it is not indexed, not watched, not added to the Files tab or the search, and the agents do not see it. Saving writes to that file on disk. One such file at a time.
  • There is no list of recently opened external files.
  • Find and replace work on the text of a file (source or editor), not on a diff of the Changes tab, and not on a PDF, an image or media. The counter stops at 10000 matches and shows 10000+.

Common questions

  • Why does my .html report open rendered instead of as code? A deliverable is not code. Use Source to see the markup.
  • Can I search inside the file? Yes: Cmd F / Ctrl F or the magnifier in the header opens Find in file with a 3 of 12 counter; Ctrl H (Cmd Alt F on macOS) opens the same panel with the Replace field, in edit mode. The palette itself only matches paths; use the Files tab's content search (⌘⇧F) to search across files.
  • Cmd F / Ctrl F jumped to the app's search bar instead of searching the file. Fixed on 2026-09-23: while the preview has the keyboard, the shortcut stays with Find in file. If it still reaches the app search, click once inside the preview first.
  • Ctrl F in the preview used to open the sidebar search instead. Fixed on 2026-09-18: the shortcut now stays in the open file as long as the preview is up.
  • Why no arrows on this preview? It was opened alone (palette, terminal link, session info); arrows only follow a list.
  • The table says "Only the first 2000 rows are shown". Switch to Source for the whole file.
  • How do I open a file that is not in my project, like ~/.zshrc or a log? File > Open File… or Cmd O / Ctrl O, then pick it. It opens with the Outside the project badge; you can edit and save it without adding its folder as a project.
  • Can the agent read the file I opened this way? No. Only the preview shows it; the project remains its folder. Give the agent the path or attach the file to a message if it needs it.
  • Why does the preview open expanded every time? The Expand to full window choice is remembered on this machine. Click Restore default size and it stays restored.