Skip to content

Join running sessions from another terminal

Available on the next release channel.

Run your sessions on a background nori host, then run nori attach in any other terminal. The attached terminal is the same TUI as plain nori, joined to the host instead of owning one.

Terminal window
nori host # start the background host (once per NORI_HOME)
nori host new --agent codex # optional: start a session and print its ID
nori attach # open the session list
nori attach 3f2a # open one session by the start of its ID

Sessions started by plain nori cannot be joined. Plain nori runs a private host inside its own process: nothing else can connect to it, and its sessions end when you quit. With no host running, nori attach exits with “no host running; start one with nori host”.

nori attach --host <ws-url> --token-file <file> joins a host on another machine. Both flags are required together. See nori host for the endpoint, token, and how to reach it safely.

One terminal controls the host at a time. Every other terminal watches.

Role Can do
controller prompt, cancel, start, close, and change sessions, answer permission requests
watcher see every update live, search files, read goals and context
  • The first terminal that connects is the controller.
  • Press Alt+T to take control. The previous controller becomes a watcher.
  • When the controller leaves, no one is promoted. Work keeps running.
  • A watcher who presses Enter keeps the draft and is told to press Alt+T.

A hint row above the footer shows this terminal’s standing (controlling, watching · read-only, RECONNECTING, or DISCONNECTED), then the session’s folder, agent, status, and Approvals: <mode>.

Ctrl+D on an empty prompt, /detach, /quit, or /exit. Leaving only closes this terminal’s connection; the host and its sessions keep running. In the session list, Ctrl+D closes the selected session instead, and in an empty list it leaves.

nori host stop stops the host and every session on it.

Every command shows in the / menu. One that cannot run is greyed with the reason, and typing it anyway shows the same reason and keeps your text.

Works in nori attach Notes
/new [folder] [agent] without a folder, uses the folder of the session on screen; Tab completes folders on the host
/agent (alias /agents) lists the agents the host can start, checked on the host’s machine. A session with no prompts yet switches in place; a prompted session keeps running and the new agent starts beside it
/model, /config controller only. Offers only the values the session advertises (no custom model) and saves nothing to your [default_models]
/approvals [ask|agent|approve-all] sets the mode of the session on screen; see approvals
/goal, /context, /compact act on the session on screen, on its host
/mention, @ search files in the session’s folder on the host; watchers can use it
/sessions, /close, /delegate, /cancel /cancel stops the turn on screen, whoever started it
/screen, /settings, /vim change only this terminal

Not in nori attach yet: /resume (“not available in nori attach yet”), and commands that need a session inside your own process, such as /fork, /undo, /diff, /status, /mcp, and /login (“not available on this host yet”). A command Nori does not know, such as an agent’s own /review, goes to the agent as a prompt.

Everything below lives on the host, so every terminal on it sees the same thing, even when the terminals use different NORI_HOME folders:

  • Prompt history. Up and Ctrl+R find prompts sent from any terminal on the host. Up sees them after the next turn ends.
  • Custom prompts. /prompts:<name> lists the host’s $NORI_HOME/commands/. Scripts run on the host, in the session’s folder, and only the controller can run one.
  • The queue. After an interrupted or failed turn, any terminal sees the paused queue. The controller can resume it, take a prompt back to edit, or drop it. Only prompts you typed yourself can be taken back.
  • Goals, context, and compaction. /goal shows the goal of the session on screen and changes it from the controller. /context reads instruction files in the session’s folder on the host. A /compact from the controller shows its result in every terminal.
  • Permission mode. Each session keeps its own mode; see approvals.

Why can’t I run ! commands from an attached terminal?

Section titled “Why can’t I run ! commands from an attached terminal?”

!cmd runs on the host’s machine, in the session’s folder, as the host’s user, with no sandbox and no approval. Nori therefore runs it only for the controller on the host’s own machine:

Terminal !cmd
plain nori runs
nori attach on the same machine runs, for the controller
nori attach --host ..., or any stdio client refused: “Remote shell commands are not yet supported.”
a watcher refused until it takes control

A refused line goes back to your prompt, runs nowhere, and never reaches the agent. When a command runs, every terminal following the session sees a Ran <command> cell with its output once it finishes.

  • The terminal shows RECONNECTING, keeps your draft, and retries every 750 ms. Requests that were in flight are not sent again; one that got no answer says “The request may have reached the host.”
  • If the host restarted in the meantime, the terminal shows “Host restarted; sessions were lost. Re-run nori attach.” and stays DISCONNECTED.
  • When a session ends on the host, the terminal stays open and shows the next session, or “Session ended. Use /new to start one on this host, or Alt+S to pick one.”

Does an attached terminal start full screen? Yes. /screen or Ctrl+L switches to the inline view and back; see sessions. Leaving from full screen prints no transcript or exit summary.

Does --yolo on nori attach change anything? No. The host applies its own configuration to its sessions.

Can I use an image from my machine with @ in nori attach? No. Picking an image inserts its path on the host for the agent to read; plain nori attaches the image itself.

this page as markdown: /cli/guides/attach.md· index for agents: /llms.txt