LatentCodeUsing LatentCode
The TUI
Run latentcode with no arguments to open the full-screen terminal UI. This page covers the screen, the prompt and everything you can put in it.
The screen
A new session opens with a welcome panel: your account and organization, the model, the working directory, a tip and what's new in this version. The prompt sits at the bottom.
The line under the prompt
While the agent is idle it shows, from left to right:
- The agent, for example Build, with
(tab to cycle). - The model and the gateway host serving it, and the reasoning effort if you've picked one.
- The working directory.
- On the right: a
TODOSchip while the agent has a task list, aGOALchip while a goal is active, and context usage asused / limit (N% left).
While the agent works, the line shows a spinner, the elapsed time and any retries. Press esc twice to interrupt it.
The sidebar
ctrl+x b shows or hides the sidebar (clicking the TODOS or GOAL chip does too). On terminals up to 120 columns wide it opens over the conversation. It shows:
| Section | Shows |
|---|---|
| Cost | What the session has cost so far. |
| Context | Tokens used out of the model's limit, and how much is left before compaction. |
| MCP | Each MCP server and whether it's connected, failed, disabled or needs authentication. |
| Todo | The agent's task list, until everything on it is done. |
| Goal | The active goal, whether it's working or waiting for you, and the turn count. |
| Loop | A running /loop: its prompt, interval, iteration and next run. |
| Modified Files | Files changed in this session, with lines added and removed. |
Writing prompts
| To | Press |
|---|---|
| Send | return |
| Insert a newline | shift+return, ctrl+return, alt+return or ctrl+j |
| Recall earlier prompts | up / down with the cursor at the start or end of the prompt |
| Clear the prompt | ctrl+c |
| Write in your editor | ctrl+x e or /editor. Uses $VISUAL or $EDITOR. |
| Send while the agent is working | Just send it. The agent picks it up at its next step. |
Pasting three or more lines, or more than 150 characters, inserts a [Pasted ~N lines] placeholder to keep the prompt readable; the full text is still sent. ctrl+o previews or edits it.
If you clear a prompt you've typed a lot into, it's saved in the history so up brings it back. To put a prompt aside and come back to it, use Stash prompt and Stash pop in the command palette.
Referencing files and agents with @
Type @ to open a fuzzy search. Pick an entry with tab or return.
| Type | Adds |
|---|---|
| @src/app.ts | The file, attached to your message. |
| @src/app.ts#10-40 | Only lines 10 to 40. |
| @src/components | A directory. |
| @explore | Hands the request to that subagent. |
| @sync: | Opens a session picker, then brings in a summary of that session's history, including sessions shared to your organization. |
MCP servers that offer resources also appear in the list.
Running shell commands with !
Type ! at the very start of the prompt to switch to shell mode, then type a command and press return. It runs in your project directory, and the command and its output become part of the conversation, so you can ask about them next.
! npm test -- --grep checkoutPress esc, or backspace at the start of the prompt, to leave shell mode.
Images and PDFs
- Paste an image from the clipboard with ctrl+v.
- Drag a file into the terminal, or paste its path. PNG, JPEG, GIF, WebP, AVIF and PDF files are attached; SVG files are added as text.
- Attachments appear in the prompt as
[Image 1]or[PDF 1].
Whether a model can read images or PDFs is set by your administrator for each model. Large images are resized before sending; see attachment.image in Configuration.
Slash commands
Type / to list commands: built-in ones, your custom commands and prompts from MCP servers (marked :mcp). /skills lists skills. The Slash commands page lists every built-in.
Reading the conversation
| To | Use |
|---|---|
| Expand or collapse reasoning, summaries and tool activity | ctrl+l |
| Show or hide thinking | /thinking |
| Show timestamps | /timestamps |
| Hide code blocks | ctrl+x h |
| Scroll | pageup / pagedown, the mouse wheel, or ctrl+alt+u / ctrl+alt+d for half a page |
| Jump to the start or end | ctrl+g / ctrl+alt+g |
| Jump to a message | /timeline or ctrl+x g |
| Copy the last answer | ctrl+x y |
| Copy the whole conversation | /copy |
When the agent starts subagents, each gets its own child session. Open the first with ctrl+x down, move between them with left and right, and go back with up.
The diff viewer
/diff opens a full-screen view of changes, with a file tree on the left. d switches between three sources:
| Source | Shows |
|---|---|
| Working tree | Everything uncommitted in your repository. |
| Main branch | Your branch compared with the default branch (only when you're on another branch). |
| Last turn | What the agent changed in its last turn. |
| Key | Action |
|---|---|
| n / p | Next / previous file |
| ] / [ | Next / previous change |
| j / k | Move down / up |
| v | Side by side or unified |
| b | Show or hide the file tree |
| tab | Move focus between the tree and the diff |
| m | Mark the file reviewed |
| ? | All shortcuts |
| q / esc | Close |
Side-by-side needs a wide terminal; narrower ones show a single column. Set "diff_style": "stacked" in tui.json to always use one column.
Themes
/themes or ctrl+x t previews and switches themes. The default is latentcode; system uses your terminal's own colors. Built in: aura, ayu, carbonfox, catppuccin, catppuccin-frappe, catppuccin-macchiato, cobalt, console, cursor, flexoki, github, gruvbox, latentcode, mercury, moss, nightowl, nord, plum, vercel and zenburn.
To add your own, put a JSON theme file in themes/ inside ~/.config/latentcode or a project's .latentcode folder; its file name is the theme name. Set the default with "theme" in tui.json.
Notifications
To get a desktop notification and a sound when LatentCode finishes, asks a question or needs approval, turn on attention in tui.json:
{ "attention": { "enabled": true, "sound": true, "volume": 0.4 } }Other ways to run it
latentcode --mini: a lighter interface that prints into your normal terminal scrollback, with the prompt in a footer. Alsolatentcode run --interactive.latentcode run "…": one prompt, no interface. See the CLI reference.
fg brings it back). ctrl+c or ctrl+d on an empty prompt, ctrl+x q, or /exit quits. Your session is saved; latentcode -c reopens it.