Skip to content

Read it in layers ​

A diff arrives in alphabetical order, which is almost never the order it should be read in. Layers are the agent's reading plan: the change split into a few layers, each with a title that says what it now makes true, a two-sentence summary, and the lines that belong to it. You read the titles first, then one layer at a time, and skip what the agent set aside as background.

Layers in Diffo: the header chip suggests layers and the reviewer accepts; the request crosses to the agent, which splits the 13-file change into four ordered layers and posts them with diffo layers; the layers land in the rail, the first layer's card draws its diagram, its files are read and ticked, and  steps to the second and third layers.Layers in Diffo: the header chip suggests layers and the reviewer accepts; the request crosses to the agent, which splits the 13-file change into four ordered layers and posts them with diffo layers; the layers land in the rail, the first layer's card draws its diagram, its files are read and ticked, and  steps to the second and third layers.

Ship fast, ship safe. A change too big to read in one sitting is layered by Importance: you read only the lines that decide how the system behaves, and the rest waits in background. See it on a 20,000-line change.

Layers come from the agent only. The session that wrote the change still remembers the order it would explain it in; Diffo never guesses a plan from paths, and with no layers the review is exactly the flat file list.

Asking for them ​

Three ways in, all the same ask:

  • The header chip. When the agent thinks the change reads better in order, it says so at open, and the header shows agent · suggests layers with the agent's reason beside it. One click.
  • The Layers tab. Its Ask the agent for layers button works whether the agent suggested it or not. Layer by, above it, picks what the layers are for; it opens on your default preset, and its menu ends with Manage presets. When the agent's suggestion names a preset and you have no default of your own, the picker opens on that one, with Suggested by the agent and its reason under it; with a default of your own, the picker stays on yours and the suggestion is a line you can take, The agent suggests Importance; the menu marks that preset suggested either way. The suggestion is remembered for the review: remove the layers later and the tab opens on it again, or on the preset the agent picked when you let it choose. Add instructions, under the button, opens a small dialog for what you want this time on top of the preset, and One-time instructions in the menu opens the same dialog to say what you want in your own words instead.
  • In the terminal. Say "layers" to the agent. It offers exactly this in its handoff message when it suggests them.

The ask reaches the agent through its poll. The tab reads Layering… and the presence chip layering the change until the layers land, a moment later.

Reading one at a time ​

Picking a layer narrows the reading pane to its files, under a card with the layer's summary. The card renders markdown, and a mermaid diagram when the step has a shape, the same way a thread does; a file the summary names is a click away.

Key
] / [Next / previous layer
.Next decision in this layer
nNext unread file, rolling from one layer's last unread file into the next
J / KNext / previous file, staying inside the active layer

Each layer carries its own progress, read off the same hunk marks Finish review reports. A layer tagged mechanical changes no behaviour, a rename or call sites following a signature, and keeps its files folded. A layer tagged background is what you can skip. Tests, docs, styling, generated files, lockfiles and build wiring always go there; by Importance, so does the implementation behind the key layers. Once there are background layers, the tab groups them under two quiet labels that fold: Key changes and Other changes, each with how many layers it holds and its lines added and removed. Other changes starts folded; open it to check something, and a layer in it reads like any other. Which groups are open is remembered. Since your review, what moved after the layers were posted, is a third group at the end, with Add to layers on its label. A hair of progress under the head fills as you mark the key changes.

The pane reads a layer's files in the order the agent put them in. The foot of the layer's card, Read the files in, offers the two orders: the agent's, or folder order, the way the Files tab lists them. J / K and n follow the pick; the rail shows the layer's files as a folder tree either way. One pick covers every layer, and it is remembered across reviews.

The book in the head of the list opens the Overview: the agent's guide to the change, and on a pull request its description. [ from the first layer goes there too. See Reviewing a pull request.

A file in two steps ​

Some files hold more than one step: the contract at the top, the call sites further down. The agent can give each step only the part that belongs to it, and the review says so wherever you look.

In the pane, the file's header carries a chip, 3 of 7 hunks, and the hunks that read in another step fold into one row where they sit:

▸ 2 hunks in step 3 · Consumers

Open the row to see them in place, dimmed, or click the step's name to go read them there. Whole file on the header opens everything: every hunk, with all the lines between. Viewed on that header marks the step's hunks, not the whole file, so reading step 1's half never ticks step 3's.

In the rail, the layer's count says 2 files · 1 split, and the file's row reads 3 of 7 hunks; its mark is that part's. On the Files tab the file says steps 1 · 3 after its name, and its mark is the whole file's, mixed while one part is read and the other is not.

How much of each file you see is yours to pick. Beside the reading order on the card, Show this layer changed offers lines | hunks | files, narrowest first, one for each way the agent can split a file. Hunks is what's above: the step's hunks, plain. Files shows every hunk of each file, other steps' hunks too, dimmed and tagged with their step, in place of the folded rows. Lines, the default, is the step's hunks with the lines the agent highlighted lit and the rest dimmed (next section). It changes only what you see — Viewed still marks this step's part. A pick that would show the same as hunks in a step is greyed, and its tooltip says why. One pick for the whole review, remembered across reviews.

Nothing can hide in the split. Every changed line belongs to exactly one step. A line no step claims lands in Since your review, lit, like a file no step lists, and the agent hears about it the moment it posts: the ack names the lines left out, and the next step is a re-post with them placed. A post where two layers claim the same line is refused.

Highlighted lines ​

The agent points at the lines each step is about. Under Show this layer changed · lines, the default, those lines keep the diff's full colour and the rest of the hunk steps back, grey — every line still there, so a hunk several steps share reads differently in each. A hunk the step highlights nothing in is not part of it: it folds under the name of the step that does highlight it, like a split file's other hunks. A file the step lists without a highlight is the step's throughout, and lights in full. Hunks and files show the same hunks plain; in a step the agent highlighted nothing in, lines is greyed. A changed line no step claims is still read, lit, under Since your review.

Viewed under a step that highlights a file marks its highlighted lines, not its hunks: reading one step's lines of a shared hunk leaves the other step's unread. A hunk counts as read once all its changed lines are, by whichever steps.

Decisions ​

Under a layer's summary the agent may list its decisions: what it chose, found, or ran into while making this step, one short line each. Most layers have none. A plumbing step has nothing to decide, and the list is absent rather than empty.

A decision is one of three things, and the line says which without a label:

  • the agent chose between real alternatives you might weigh differently: a cache, a data shape, a fallback
  • the code now does something the diff does not make obvious: a 400 where there was an empty list, a sort every caller sees
  • something in the repo or the environment shaped the change: no clock on the model, tests that could not run

Each line is a plain statement a teammate who has not seen the code gets in a second: the effect, not the mechanism. Read the lines before the diff, or instead of it. Click one and the card opens under it: one sentence from the agent, then a chip for each place the decision names (a decision can span hunks, the rule and the test that pins it) that goes there, and Comment. . walks the layer's decisions one by one, landing on the first place of each.

Comment opens the layer's own comment box with the decision quoted, so the thread sits with the step the agent explained rather than on a line that may move, and the agent knows which decision is meant. Like a summary, a decision never pre-reviews: it says what was done and why, never whether it is fine.

What the layers are for ​

The same change can be layered more than one way. A preset says how: what to read closely, in what order, and what goes to background. The head of the Layers tab names it: Layered by Importance.

PresetYou getUse it when
ImportanceOnly the lines that decide how the system behaves: up to seven layers and about 150 lines, one rule per layer, the costliest first; everything else in backgroundThe change is too big to read in one sitting, and you want to sign it off fast and still safely
ConceptOne feature, refactor or fix per layer, three to eight for most changes, each building on the ones before; tests and docs in backgroundYou'll read the whole change
Let the agent chooseThe default. The agent goes by size and says so: Concept up to about 500 changed lines, Importance past that. Tests, docs, styling and generated files are not countedYou're not sure

By Importance a line is key when it sets or changes a rule of the system:

  • data: what is stored and in what shape, a migration, anything that cannot be taken back
  • authority: who may do what
  • contracts: what callers and other systems get, a limit, a default
  • the rule itself: the condition or value that decides the outcome
  • effects that leave the system or cannot be undone
  • what stopped happening: a check that no longer runs, an error that no longer surfaces

Imports, renames, moved code, call sites, styling, tests, docs and generated files are never key, however large.

A 20,418-line pull request in Diffo, layered by Importance: organizations, roles and SSO across 214 files, opened alphabetical. The reviewer picks Importance under Layer by and asks the agent, which keeps 152 lines in five key layers, the deciding sections of each: the schema migration, the SSO sign-in, the roles and permission checks, the API routes that break, and the API keys it removed. UI, call sites, tests, fixtures and docs go to Other changes, folded.A 20,418-line pull request in Diffo, layered by Importance: organizations, roles and SSO across 214 files, opened alphabetical. The reviewer picks Importance under Layer by and asks the agent, which keeps 152 lines in five key layers, the deciding sections of each: the schema migration, the SSO sign-in, the roles and permission checks, the API routes that break, and the API keys it removed. UI, call sites, tests, fixtures and docs go to Other changes, folded.

  • Change it: Layer again, in the head's more menu or under the list, opens a small dialog. Pick a preset and press Layer again; nothing re-layers on its own.
  • A note for this change: For this change only, in the same dialog (up to 400 lines, keep the tests in background). It wins over the preset and isn't saved.
  • No preset: One-time instructions layers the change by what you write, once.
  • Remove layers: in the more menu. Your read marks and threads stay.

Your own presets ​

Manage presets, in the Layer by menu or the gear menu, opens the Layers presets dialog.

  • New preset: tell the agent what to review and what to skip (only the public API and anything that writes to disk) and it writes the preset, or Manual edit to type it yourself.
  • Change one: say what to change in its conversation. The agent edits it, and every edit has an undo.
  • Built-ins can't be edited: Make a copy to edit, or ask the agent for a copy.
  • More on a preset: Make default, Disable, Delete.

Presets live on your machine, not in the repo, and follow you to every review.

The plan stays honest ​

Layers are resolved against the live changeset on every refresh. A file the agent touches after posting, one no layer names, or the hunks of a split file that no step claims any more, gather in a trailing Since your review layer, so nothing hides outside the plan. Add to layers, on the Since your review label, is the light way to absorb them: the agent puts them in the layers you have, and nothing else changes — same layers, same preset, same note, no dialog. Layer again, in the head's menu, is the full one: a new split of the change. Either way a re-post keeps your place for every title that survives.

Read marks live on hunks and their lines, not on layers, so a re-post can never lose one.

Commenting on a layer ​

A question about the step itself, not a line in it: why these files belong together, whether the order is right, a summary that says too much. The layer's card has Comment on this layer in its corner, and the thread lives under the card, with the agent on the other end like any other thread. The agent is handed the layer as it was when you wrote the comment, title, summary and files, so a later re-post never changes what you were asking about.

A layer thread follows its layer by title across re-posts. A re-post that drops the title retires the thread with it: it moves to the threads the changeset left behind, intact, and a thread you had sent reads as addressed.

Only the agent's layers take a comment. Since your review is Diffo's, not the agent's, and the pull request Overview is the description: comment on those the way you would on the whole changeset. On a pull request a layer thread is always private; GitHub has no layers to post it to.

What a layer may say ​

The title is the finding. It is one sentence saying what is now true, so reading the titles alone tells you what the change does:

Not thisThis
Export permissionsAny workspace member can now export the whole workspace
Is every retry still bounded?Webhook deliveries to a failing endpoint now retry forever
Refactor the auth middlewareSessions are no longer checked against the workspace in the URL

A title states only what the layer's lines show. Background and mechanical layers are titled plainly by what they hold: Tests, Call sites and imports.

The summary is two sentences, about forty words: what was true before and what is true now, with the real values, then what follows from it. It follows the guide's rule: it orients your reading and never pre-reviews it; no verdicts, nothing declared "fine". When a behaviour change is one nobody asked for, the summary says so.

The order is the preset's. By Importance, what would cost the most if it were wrong comes first, so stopping after two layers still means you read the two that matter most. By Concept, each layer needs only the ones before it. Mechanical and background layers always come last.

The agent's side ​

Two commands: diffo layers --suggest "<why>" [--preset <id>] at open, and diffo layers --json '<Layer[]>' to post, only when you ask. Layers in the agent protocol has the doctrine, and the CLI reference has the shape of a layer.

Released under the Apache-2.0 License.