Code Review

Published

Updated

Every coding session runs on its own branch. The diff viewer lets you see exactly what Claude changed before you merge anything.

The Diff Viewer

Open a task and select Code on tablets or desktop to review changes on the selected session's branch against the base branch. Changes appear as the agent works. When files have changed, a pill above the task composer shows the number of changed files, lines added, and lines removed. Select it to open the diff. On tablets and desktop, it selects the existing Diff pane; an embedded Inbox task stays in its single pane.

When the diff pane is wide enough for the file tree and a readable diff column, the changed files sit in a sidebar on the left and the selected file's diff fills the rest of the pane. Narrow windows keep the compact file selector. The layout follows the pane's own width, so it does not depend on the pane being maximized.

A summary bar above the diff carries the file count, total lines added and removed, a proportion bar, and chips for the change types in the diff.

Unified or Side by Side

The summary bar carries a Unified / Split toggle. Unified stacks deletions and additions in one column; split puts deletions on the left and additions on the right. The choice persists as you move between files.

Runs of unchanged context longer than 12 lines collapse to an Expand N unchanged lines band, with three lines of context kept on each side. Click the band to open that region.

Image files render as image cards rather than binary text. On web, j and k move between files without leaving the keyboard.

Reading the Diff

  • Green lines (prefixed with +) are additions.
  • Red lines (prefixed with -) are deletions.
  • Each file in the list shows per-file stats: +X lines added, -Y lines removed.

A modified line shows up as a deletion followed by an addition.

File Navigation

On tablets and desktop, the file list sits alongside the diff content. Select a filename to jump to its changes, or filter by name or change type to scope a large change set. On phones, open Files in the Code Changes tray and select a filename to view it in Code.

Files with more than 500 combined lines of additions and deletions show a Load diff prompt instead of rendering immediately. This prevents the view from locking up on massive changes. Click the button to load the full diff when you're ready.

Reviewing Changes on a Phone

On iPhone and Android phones, open the Code Changes tray from the change totals pill above the task composer. Code shows the selected file's diff. Its file row shows the filename, directory, and lines added and removed. Tap the row to open Files, swipe between files, or use Previous and Next. Open Branch to see the base and working branch links, copy either link, and check the file count.

The phone diff hides raw patch headers and labels each change block by its nearby line. Long code lines scroll horizontally without wrapping.

In Files, search by name or use Filter to show a change status when several statuses are present. Expand folders to browse the tree, then tap a file to return to its diff in Code. For a task with multiple repositories, use the repository selector in either segment. The tray remembers the selected file and any Load diff choice for each repository when you switch repositories or segments. Branch links follow the selected repository.

Branch Stats

The header above the diff shows total commits on the branch, total lines added, and total lines removed. Use this for a quick sense of scope before diving into individual files.

When the Diff Viewer Is Offered

Code Diff is listed only when the session actually has changes. On a task where nothing has been touched yet, the option is absent from the view pickers, the phone's Code menu, and the web workspace toolbar, so you cannot open it to an empty screen. It appears as soon as the first change lands, which can be a moment after the task opens while the diff loads.

A pane you have already pinned to the diff keeps showing it, with its own empty state, rather than dropping out from under you while Claude works.

When a Diff Cannot Load

The panel names the reason it failed. A branch with nothing pushed yet says so; a missing GitHub token says to add it in Settings → Integrations; anything else shows the message the server returned, so you are not left guessing at a cause that does not apply.

Opening a Pull Request

A task offers Create PR in its header once the session has changes to publish. Until a session has changes or commits in at least one of its repositories, the button is not there, so you cannot open an empty pull request form. A session working across several repositories gets the button as soon as any one of them has work.

Once the task has a pull request, the header switches to PR #N (or View PR when the number is not known yet) and opens it on GitHub.

On a phone, the pull request action sits in the Code segment of the Code Changes tray. Open the tray from the change totals pill or another diff entry point, then select Open PR (or PR #N / View PR). Open PR closes the tray and brings up the pull request form; View PR leaves the tray open and links out to GitHub.

You can also ask the agent for one. An agent knows the branch its session publishes to and may push it, so it opens the pull request in the same turn it makes the change rather than deferring to a later one.

Tasks run by a playbook do not show either: the playbook's own steps open and manage the pull request. See Playbooks.