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 TODOS chip while the agent has a task list, a GOAL chip while a goal is active, and context usage as used / 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:

SectionShows
CostWhat the session has cost so far.
ContextTokens used out of the model's limit, and how much is left before compaction.
MCPEach MCP server and whether it's connected, failed, disabled or needs authentication.
TodoThe agent's task list, until everything on it is done.
GoalThe active goal, whether it's working or waiting for you, and the turn count.
LoopA running /loop: its prompt, interval, iteration and next run.
Modified FilesFiles changed in this session, with lines added and removed.

The command palette

ctrl+p lists every action with its shortcut: switching sessions, models and themes, toggling display options, stashing a prompt, and more. Start typing to filter. Some actions exist only here, such as Show sidebar, Stash prompt and Copy last assistant message.

Writing prompts

ToPress
Sendreturn
Insert a newlineshift+return, ctrl+return, alt+return or ctrl+j
Recall earlier promptsup / down with the cursor at the start or end of the prompt
Clear the promptctrl+c
Write in your editorctrl+x e or /editor. Uses $VISUAL or $EDITOR.
Send while the agent is workingJust 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.

TypeAdds
@src/app.tsThe file, attached to your message.
@src/app.ts#10-40Only lines 10 to 40.
@src/componentsA directory.
@exploreHands 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 checkout

Press 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

ToUse
Expand or collapse reasoning, summaries and tool activityctrl+l
Show or hide thinking/thinking
Show timestamps/timestamps
Hide code blocksctrl+x h
Scrollpageup / pagedown, the mouse wheel, or ctrl+alt+u / ctrl+alt+d for half a page
Jump to the start or endctrl+g / ctrl+alt+g
Jump to a message/timeline or ctrl+x g
Copy the last answerctrl+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:

SourceShows
Working treeEverything uncommitted in your repository.
Main branchYour branch compared with the default branch (only when you're on another branch).
Last turnWhat the agent changed in its last turn.
KeyAction
n / pNext / previous file
] / [Next / previous change
j / kMove down / up
vSide by side or unified
bShow or hide the file tree
tabMove focus between the tree and the diff
mMark the file reviewed
?All shortcuts
q / escClose

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:

JSONC
{ "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. Also latentcode run --interactive.
  • latentcode run "…": one prompt, no interface. See the CLI reference.
Note
Suspend and quit
ctrl+z suspends LatentCode to your shell (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.