Skip to content

Threads and modes

Code from the terminal

Run a coding agent from your terminal with the octant command — start in a repository, steer it, answer its approvals, and pick up where you left off.

  • 8 min read
  • 9 sections

Code from the terminal ​

The octant command opens a full-screen agent in your terminal. It is the same thread the app shows: start it in a terminal, glance at it on your phone, and finish it in the desktop app.

Start in a repository ​

bash
cd ~/code/my-repo
octant

That is the whole start. octant on its own, at a terminal, opens the agent on the folder you are in:

  • Inside a folder you added as a Code Project, it starts a Code thread there, in the current checkout.
  • Inside a Work Project, it starts a Work thread.
  • Anywhere else, it starts a Chat thread, which cannot touch your files.

If the host is not running, octant starts it first and waits for it.

To start with a task, give it as a quoted prompt:

bash
octant "fix the failing tests"

The prompt is the first message, and the screen stays open so you can keep going. Use --prompt instead when a script needs one reply and an exit; see Run one prompt from a script.

The first time in a repository ​

Started inside a Git repository that is not a Project yet, octant asks once:

text
/home/you/code/my-repo is not an Octant Project yet.
Add it as a Code Project? [Y/n]

Press Enter (or type y) to add the repository's top folder as a Code Project and start a Code thread in it. This is the same as octant project add <folder>: the host checks the folder before it binds it. Type n to add nothing and start a Chat thread instead. A no is not remembered, so you are asked again the next time.

Nothing is asked when there is no terminal to answer (a pipe or a script) or with --json.

Upcoming change

Before this update, Ctrl+P pauses or resumes the run. The upcoming terminal client moves pause or resume to Ctrl+O and uses Ctrl+P for the command palette. The provider picker, responsive panels, checkout review and Work questionnaires described below are also not released yet.

The screen ​

The conversation fills the screen: your messages and the lead's replies with timestamps, and under each reply the actions it took as a tree, the last few in full and the rest folded into one line. A spinner marks the call still running and failures show in red. A Tasks panel appears when the lead keeps a task list, and a panel at the bottom shows a pending question, an approval, or the suggested follow-ups. The footer shows the model, the run's status, and token use.

At 100 columns the screen also shows the Project's thread list. At 140 columns it adds thread information, reported usage, host MCP connection state and a cached snapshot of checkout changes. The snapshot refreshes when you run /diff; it is not a live observer. Ctrl+B toggles the thread list and Ctrl+G toggles information at smaller widths. Unknown usage is labelled as unreported.

Replies arrive as they are written: the terminal follows the same live feed as the app.

The screen uses the app's theme. --theme system|light|dark|octant picks the preset, and your terminal's light or dark mode picks the palette.

Talk to the agent ​

KeyWhat it does
EnterSend. While the lead works, Enter queues a note for its next step instead.
Shift+EnterNew line
EscStop the running turn
Ctrl+CStop the running turn; press it twice to quit. With text selected, it copies.
Ctrl+EShow or hide each call's diff and output
Ctrl+RShow or hide the model's reasoning
Ctrl+POpen the command palette; type an action and press Enter
Ctrl+OPause or resume the run
Ctrl+JOpen another thread waiting for you; unsent composer text is preserved
TabComplete the first suggested file or thread
PgUp, PgDn, Ctrl+Home, Ctrl+EndScroll
?The key list

Type @ for file suggestions from the Project. Paths containing spaces are quoted in completion and parsed as one path. Code and Work pass source paths to the agent and stage image attachments; Chat can attach images, PDFs and text. # brings in another thread as read-only context.

Review its changes ​

A Code thread starts approval-gated unless the Project or --access says otherwise, so edits and commands ask you first, right in the terminal. Ctrl+E shows the diff or output of every call, so you can read what changed without leaving the screen.

  • Answer an approval with y (allow once), a (allow for the session, where offered), or n (deny).
  • Answer a question by typing an option's number, or type your own answer.
  • A Browser site request asks the same way.

Use /diff to refresh and inspect the current checkout's unified diff snapshot. It may include changes made outside this thread. The view names truncated results and paths whose diff text is unavailable. Esc returns to the conversation; a pending approval or question also closes review.

Every surface sees the same approval, so you can also answer it in the app or on your phone; the terminal closes its prompt when another screen answers first.

When a Work agent asks for a secret, such as an API token, type or paste it on the full screen. It is never shown; the panel counts the characters typed. Enter sends it, and Esc clears it. Line mode doesn't take secrets; answer in the app.

Answer a Work questionnaire ​

When a Work agent asks several related questions at once, the full screen shows them one at a time, as Question 1 of 3 and so on. Recommended options are marked, and options with descriptions show them.

  • For a single-choice question, type one option's number.
  • For a question that takes several choices, type their numbers separated by commas or spaces, for example 1, 3.
  • Type 0 to choose nothing, when the question allows that.
  • Type your own answer instead, when the question allows that. If your answer is a number, start it with =, for example =12, because a bare number chooses an option. To send an answer that itself starts with = and a number, double it: ==12 sends =12.

If an answer doesn't fit the question, the terminal says why and asks the same question again. Your earlier answers are kept. After the last question, the terminal asks for an optional comment; press Enter to skip it. It then sends all your answers together, just as Send answers does in the app. If your answers are refused, the terminal starts again from the first question.

Line mode (--plain) doesn't show Work questions or approvals. Answer them on the full screen or in the app.

When a Work agent asks to leave Plan, its approval shows the whole plan the agent hands over, then the access mode the thread will switch to, just above the y/n prompt. Scroll up with PgUp to read a long plan.

Slash commands ​

CommandWhat it does
/steer <text>A note for the lead's next step
/pause, /resumeHold or release the run
/next NTake suggested follow-up N
/goal, /goal revise <text>Show the goal, or change its objective
/notesShow retained notes; /notes copy, /notes discard
/side <text>Ask Side Chat, which only reads; /back returns
/agents, /agent N, /agent N <text>List helper agents, show one, or reply to it
/forkFork the thread at the last reply
/checkpoint, /checkpoints, /restore NMark, list, or restore checkpoints
/newStart another session in the current Project
/files, /diff, /diff NList changed files, review the checkout, or open one listed file
/next-waitingOpen another waiting thread in this mode
/effort <value>Set an effort value the current model offers
/model, /model NList models, or switch the thread to one
/threads, /open NList your threads, or switch to one
/copyCopy the last reply (works over SSH too)
/quitLeave the screen; the thread stays on the host

Pick up where you left off ​

bash
octant --last

--last continues the latest Code or Work thread of the Project you are in; anywhere else, your latest Chat thread. --thread <id> opens a specific thread in whatever mode it has. A Code thread keeps its conversation from one run to the next, tool calls included.

Choose the model and access ​

bash
octant --model my-endpoint/my-model \
  --access accept-edits "add a changelog entry"

Set a shared default model in Settings › Code or Settings › Chat & Work. New threads in the app and terminal use that host default.

Enabled coding providers include native runtimes such as Codex and Claude Code, as well as the Octant Harness. If no usable model default is set, an interactive terminal asks you to choose. Without a usable default, a script must pass a unique --model.

--model and --access apply to a new thread. To change them on an existing thread, use its model picker or mode picker in the app, or /model on the screen. --access full-access --sandbox keeps the sandbox on at Full access. Threads: access modes explains the levels.

Run one prompt from a script ​

bash
octant agent --prompt "Summarize open pull requests"

--prompt sends one prompt, prints the reply, and exits, with a nonzero status if the host refused it. --json prints one JSON object per line, and --plain keeps the line-by-line mode even on a terminal. A pipe gets the line-by-line mode on its own.

Without a terminal, a bare octant prints the usage list instead of starting an agent, so a script that forgets its command does not wait.

Octant documentation · local-first by design