Agent reference
Tip
The agent reference is for coding agents. For the keystrokes the user presses in the workspace, see Navigating the workspace.
Enable interaction
Run laura ready once per workspace before opening a pane. Until you run laura ready, the user can't comment (c) or submit an inline review (Shift+S).
laura ready prints one JSON object: journal (the journal path), experimental (the experimental features enabled in the workspace; use only those), web_app (true in the web app, false in the TUI), browser_url (where the agent's browser tools connect to Laura's browser, or null), and layout (what's already open, the same report as laura layout). Run laura ready at the start of every new chat, because panes from earlier chats may still be open. layout is null when the running Laura is older than the laura CLI; run laura layout instead.
Outside a Laura workspace, laura ready exits 1 with not inside a Laura workspace.
Laura holds laura CLI commands while the user is typing a comment or review body. Do not kill or retry a command that is waiting.
Preview layout
laura layout and laura open --dry-run both print a JSON report with one entry per pane, its rect and overflow:
{
"area": {"x": 0, "y": 0, "width": 120, "height": 40},
"panes": [
{"id": 0, "kind": "pty", "path": null, "rect": {"x":0,"y":0,"width":48,"height":40},
"content_rows": null, "visible_rows": 38, "overflow_rows": 0, "clipped": false},
{"id": 1, "kind": "panel", "path": "spec.md", "rect": {"x":48,"y":0,"width":72,"height":40},
"content_rows": 120, "visible_rows": 38, "overflow_rows": 82, "clipped": true}
]
}
When overflow_rows is above 0, or clipped is true, the content overflows the pane and the user has to scroll to read the full content. laura open also warns on stderr when a file's content overflows (pane #N overflows: …), and when the pane is too small to show any of it (pane #N too small to render …).
Open a pane
laura open <path> # auto-tile: split the newest pane, alternating orientation (dwindle); prints the new pane id
laura open <path> --split <id> # override: split a specific pane instead
laura open <path> --dir v --ratio 30 # override: v stacks / h side-by-side; new pane gets 30%
laura open <path> --side first # override: new pane lands on the first side of the split
laura open <path> --no-focus # open without moving focus into the pane
laura open <path> --dry-run # print the would-be overflow report; open nothing
laura open <path> --panel <id> # swap a pane's file in place — same id, rect, focus
laura open <path> --edit # run Neovim on the file in an editor pane; never takes focus
With no split flags, Laura tiles laura open <path> automatically: Laura splits the newest pane and alternates the orientation (a dwindle). Any split flag overrides the automatic tiling. When a split would shrink a pane below the minimum size, laura open returns an error (exit 1). laura open prints the new pane id; capture the id to target that pane later.
When you open a file that's already open, in a new split or with --panel, Laura still opens the file and warns already open in pane #N. Reuse pane N (laura highlight --pane N) unless you want to show two distinct sections of the same file. If pane N has an unsubmitted inline review, the warning ends with , which has an unsubmitted inline review. In that case, use the new pane and leave pane N to the user's inline review.
laura open --panel returns an error (exit 1) in two cases:
- The pane has an unsubmitted inline review. Ask the user to submit (
Shift+S) or refresh (Ctrl+R). - The pane is an editor pane with unsaved edits. Ask the user to save (
:w) or quit Neovim.
Use --edit to open an editor pane when the user wants to edit the file:
- Laura never focuses an editor pane, so tell the user the editor pane is open and to press
Ctrl+Pthen the pane id shown on its border. --panel <id> --editon the file the pane already shows attaches Neovim to that pane and keeps its threads. On another file,--panel <id> --editreplaces the pane like--panel.- Editor panes show no highlight or diff.
--editwith--highlightor--diff, andlaura highlightorlaura diffon an editor pane, return an error (exit 1). Annotate the lines withlaura commentinstead; the user sees the thread count on the pane's border while editing. - When
--editreturnseditor panes are experimental: …oreditor panes need Neovim: …(exit 1), open the file with plainlaura openand don't retry.
Highlight a section for the user
laura open src/x.rs --highlight 40 52 # open a file already scrolled to and highlighting lines 40–52
laura highlight 40 52 # highlight in an already-open pane (1-based, inclusive)
laura highlight 40 --pane <id> # single line, in a specific (possibly unfocused) pane
laura highlight --off # clear the highlight (the user can also press `h` on the pane)
laura highlight 'main > h1' --pane <id> # an element in a browser pane, by CSS selector
laura open --highlight opens the file and highlights the lines in one call, with the pane already scrolled to the range. laura highlight moves the highlight in an open pane. The highlight stays until you set a new one or clear it. On a frozen pane, laura highlight returns an error (exit 1), but --off still clears the highlight.
In markdown:
- Code blocks, HTML blocks, list items, blockquote lines, and callout lines keep one number per line, including blank lines.
- Laura shows a hand-wrapped paragraph as one block, and highlights the whole block for any of the paragraph's lines.
- Laura does the same for a fenced block or table inside a list item or blockquote.
Show what changed
Laura tints each line changed since git HEAD in a file pane, and updates the tints when the file reloads.
- Laura needs
gitonPATHfor the tints. Withoutgit,laura openwarnsdiff markers unavailableon stderr, and Laura shows a notice and no tints. - In markdown, Laura tints the rendered rows of the paragraph or block that holds the changed source line.
- When the user deletes the last lines of a file, Laura shows the
── N lines removed ──row below the last line. - Laura shows no tints on an untracked file until the file is committed.
See the full diff inline
Laura's tints show where lines changed. In the diff view, Laura shows what changed: Laura replaces the pane's content with an interleaved +/- diff against git HEAD, with deleted lines as red - rows holding their old text.
laura open src/x.rs --diff # open straight into the diff view
laura diff --pane <id> # toggle the diff view on an open pane
laura diff --pane <id> --off # back to the normal file view
Close a pane
laura close # close the focused pane
laura close <id> # close a specific pane by id
laura close --all # close every pane, back to shell-only
laura close returns an error (exit 1) in two cases, and with --all closes nothing:
- The pane has an unsubmitted inline review. Ask the user to submit (
Shift+S) or refresh (Ctrl+R). - The pane is an editor pane with unsaved edits. Ask the user to save (
:w) or quit Neovim.
Read an inline review
When the user submits an inline review, you receive a [laura review · pane #<id> · <path>] block in the chat. Treat the block as feedback on that file: address each L<n> thread (line numbers are 1-based) and the review body, then edit the file. To reply in a thread, run laura comment <line> "…" --pane <id> with the pane id from the block.
Each L<n> is a thread, and each comment starts with its author (> [user] …, > [agent] …). Each line of a multi-line comment starts with >. An inline review is a call and response: the block holds the whole conversation on that file. You only see the user's comments when the user submits (Shift+S); you can't read them from the pane.
An inline review from a browser pane has the page's URL in its header. Each thread starts with the element's CSS selector and quote (the first 60 characters of the element's text) in place of L<n>. A thread on another page starts with that page's URL:
[laura review · pane #4 · http://localhost:5173/settings]
Tighten the form before we add validation.
main > form > button:nth-of-type(2) "Save changes"
> [user] This button should be disabled until a field changes.
http://localhost:5173/profile #email ""
> [user] Needs a label.
Use the selector and the quote to find the element's code, such as the component that renders the element.
To reply in a thread on a browser pane, run laura comment '<selector>' "…" --pane <id> with the selector from the block. The element must be on the page that the pane shows now. Browser panes lists the errors.
Annotate a file
laura comment 42 "handled — see the retry loop" # reply on line 42's thread (starts one if none)
laura comment 42 "…" --author reviewer # attribute to a name (default: the session's ready --agent, else agent)
laura comment 42 "…" --pane <id> # target a specific (possibly unfocused) pane
<line> is a 1-based source line (same mapping as laura highlight), and <body> is required. When <line> is past the file's end, laura comment returns an error (exit 1) and places no comment.
Annotate only when you need the user's answer in a thread. Your comment starts an unsubmitted inline review that only the user can submit or refresh. Until the user does, you can't close or replace the pane.
If you edit a file while the user has an unsubmitted inline review on it, Laura freezes the pane until the user submits or refreshes. An inline review from a frozen pane starts with a ⚠ file changed banner, and its line numbers refer to the snapshot, not your edited file. Each thread header quotes its source line; use the quoted text to find the line in the edited file.