# Session Management

This page says what each agent status means in the TUI and the desktop app, what a TUI card shows, how to leave agents running and come back to them, and how to start from an empty workspace.

## Session Statuses

The daemon sets each agent's status from the events its hooks report (see [Installation → Agent hooks](installation.md#agent-hooks)). The TUI shows it on the agent's card; the desktop app shows it in the **Status** column of the [Dashboard](desktop/dashboard.md); `dot-agent-deck daemon status` prints the daemon's name for it.

| TUI card | `daemon status` | Desktop app | Meaning | What to do |
|---|---|---|---|---|
| **Thinking** | `Thinking` | thinking | The agent is reasoning before it acts. | Nothing. |
| **Working** | `Working` | working | The agent is running a tool; the card shows which. | Nothing. |
| **Compacting** | `Compacting` | compacting | The agent is compressing its context window. | Nothing. |
| **Needs Input** | `WaitingForInput` | needs input | The agent is waiting for a permission answer, a choice from a menu, or other input. | Answer it in the pane. In the desktop app you can also [answer it by voice](desktop/voice.md#answering-an-agents-question). In the TUI's command mode, `y` / `n` on the selected card types `y` or `n` into the pane: Codex takes that as approve / deny, while Claude Code and OpenCode ignore it. |
| **Idle** | `Idle` | idle | The agent finished its turn and is waiting for a prompt. Work it left running from an earlier turn, or subagents it left running, are shown beside it; see [Work left running after a turn](#work-left-running-after-a-turn). | Give it the next prompt. |
| **Waiting** | `Waiting` | waiting | The agent's turn ended while a command it started in that turn is still running, such as a build or a server it ran in the background. Its work is not finished, but nothing needs you. The `Background:` line under it says what is running; see [Work left running after a turn](#work-left-running-after-a-turn). | Nothing: it turns **Idle** when the command ends. You can still give it a prompt. |
| **Error** | `Error` | error | The agent reported a failure, or a deck message could not be delivered. Provider failures include an API error or a model the account cannot use. | Read the pane and any `not delivered: …` notice. |
| **Blocked** | `Blocked` | blocked | The agent's provider refused it because a usage limit or credit pool is exhausted. | Wait for the limit to reset, switch account or provider, or add credit. See [Blocked](#blocked). |
| **No agent** | — | running | The pane is not running an agent the deck recognises (for example a plain shell), or the agent has not reported yet. | If it is an agent, see [Troubleshooting → Hooks](troubleshooting.md#hooks). |

A newer daemon can report a status this build does not know; both the TUI and the desktop app show it as **Idle**. That is how an older TUI or desktop app shows **Waiting**: as **Idle**, with the `Background:` line under it.

### Which agents report which status

The first five statuses come from each agent's hooks, plugin or extension, and how finely an agent separates them depends on what it reports: Pi's extension, for example, reports **Thinking**, **Working** while a tool runs, **Idle**, and **Needs Input** while a dialog another Pi extension shows is waiting; Pi asks no permission prompts of its own. Error, Blocked and when Needs Input appears depend on the agent:

| Status | Claude Code | Codex | OpenCode | Pi | Devin | Antigravity |
|---|---|---|---|---|---|---|
| **Error** for a failed provider turn | Yes, 2.1.78 or newer | Yes, a few seconds after the failure | Yes | No | No | Yes, with `agy`'s message |
| **Blocked** | Yes, 2.1.78 or newer | Yes | Yes, once OpenCode stops retrying (it shows **Thinking** while it retries) | No | No | No |
| A subagent's permission prompt told apart from the main agent's | Yes | Yes | Yes | No | No | No |
| **Needs Input** for a permission prompt | Yes | Yes | Yes | Pi asks none of its own | Yes | Yes, with what it asks |
| **Needs Input** for a multiple-choice question or form | Yes | Yes, in Plan mode | Yes | Yes, for dialogs other Pi extensions show | Unverified | Unverified |
| The question and its options known to the deck, so it can be [answered by voice](desktop/voice.md#which-questions-each-agent-can-answer-by-voice) | Yes, 2.1.136 or newer | Yes | Yes; on OpenCode 2, forms only in its full interface, not in `opencode mini` | Yes, for dialogs other Pi extensions show | Permission prompts only, untested | Permission prompts |

- A Codex card follows Codex's hooks the way a Claude Code card does. In the TUI it shows **Idle** from the moment Codex starts until you send a prompt, **Thinking** and **Working** (with the tool) during the turn, **Needs Input** while a permission prompt is on screen, and **Idle** again when the turn ends, however much Codex redraws its screen (the desktop app shows the same words). That needs the deck's Codex hooks to be trusted. When they are not (see [Troubleshooting → Codex events not showing](troubleshooting.md#codex-events-not-showing)), the card can only tell whether Codex's screen is changing: the TUI shows **Thinking** while Codex is drawing, including while you type into it and for a few seconds after it starts, and **Idle** once the screen has been still for about three seconds. In that case it shows no tool, no prompt and no **Needs Input**, and a turn waiting on a permission prompt reads **Idle**.
- A Codex pane whose command runs `codex` directly reports its own status, in the TUI and the desktop app alike. When you run Codex through a launcher, script or alias, that launcher has to start Codex without its shared background server, or two panes can report as one: see [Troubleshooting → Two Codex panes report as one](troubleshooting.md#two-codex-panes-report-as-one).
- For Claude Code, Error and Blocked need the `StopFailure` hook, which the deck installs only when `claude --version` reports 2.1.78 or newer. After upgrading Claude Code to 2.1.78 or newer, run `dot-agent-deck hooks install` (or restart the daemon) to add it.
- For Claude Code, the question and its options need the `PermissionRequest` hook, which the deck installs only when `claude --version` reports 2.1.136 or newer. Older versions still show **Needs Input**, without the question. After upgrading, run `dot-agent-deck hooks install` (or restart the daemon) to add it.
- An Antigravity card follows `agy`'s hook and `agy`'s own status report. It shows **Idle** once `agy`'s input box is up, **Thinking** while the model works, **Working** with the tool while one runs, **Needs Input** while `agy` waits for a permission, a sign-in or a folder-trust answer, **Error** when a turn fails, and **Idle** again when the turn ends or you interrupt it (the desktop app shows the same words). Next to **Needs Input** and **Error** the card shows `agy`'s own words, such as `Approve Bash: rm -f probe.txt` or `Sign in required`: in the TUI under `Dir:`, in the desktop app on the agent's tile. An `agy` started from a shell inside a pane shows **Needs Input** and an interrupted turn from its first prompt on, once its hook tells the deck that `agy` runs there; before that prompt its card does not show a start-up question such as `Trust this folder?`. The deck reads no usage limit from `agy`, so an Antigravity card never shows **Blocked**; a turn that fails shows **Error** with `agy`'s message. See [Installation → Antigravity CLI](installation.md#antigravity-cli).
- Pi's dialogs are known through behaviour Pi does not document, checked with Pi 0.87.1; a later Pi release may stop it working. Whether Devin reports its multiple-choice questions has not been checked.
- On OpenCode 2, a form asked in `opencode mini`, or one with a question that appears only after another is answered, a hidden field or a field OpenCode fills in from elsewhere, shows **Needs Input** and is answered in OpenCode's pane; in `mini` the card says `answer this form in OpenCode: <the form's title>`. See [OpenCode 1.x and 2.x](installation.md#opencode-1x-and-2x).
- OpenCode reaching Anthropic through an Anthropic "credit balance is too low" error does not turn the card Blocked; that error carries no marker the deck can read.
- Where a subagent is told apart: when a subagent's permission prompt is settled — it is allowed and the call it asked about finishes, the subagent stops or fails without it being answered, or, for OpenCode, it is answered either way — the card goes back to Idle if the main agent's turn had ended, or to Thinking if it is still running. An OpenCode subagent's question is told apart the same way, and is settled when it is answered or dismissed, or when the subagent stops. While the main agent's own prompt or another subagent's is also waiting, the card stays on **Needs Input**, and another subagent finishing a tool call does not answer it.

### When a question waits

When an agent asks a question the deck knows about (a permission prompt, a menu or a form; see the table above), you can answer it from the deck for as long as it waits, whether that is a minute or the next morning: in the agent's pane, from the desktop app, or [by voice](desktop/voice.md#answering-an-agents-question).

While it waits, both clients show it and remind you once:

- The TUI card ends its title with `QUESTION` and how long the question has waited, for example `QUESTION 12m`. A card too narrow for it shows the badge on a row of its own. The desktop app's tile shows the same badge.
- Once a question has waited 10 minutes, the deck sends one notification for it, titled `Question waiting 10m`, naming the agent and its question. It does not repeat for that question, and a question answered sooner sends none.

To change the wait, or turn the notification off:

- **TUI:** `dot-agent-deck config set notifications.question_after_minutes 30`; `0` turns it off. The TUI sends the notification to your terminal as an OSC 9 notification, which terminals such as iTerm2, WezTerm and Ghostty show as a system notification. A terminal that doesn't support it, or tmux unless it passes the sequence through, shows nothing, and the card's badge is then what tells you.
- **Desktop app:** **Settings → Notifications**, under "Notify when a question waits": 5, 10, 15, 30 or 60 minutes, or **Off**. It is stored in `desktop.toml` as `notify` under `[questions]`, in minutes, with `0` for off.

Each client has its own setting and sends its own notification, so with both open you get one from each. Neither notifies for a question whose answer the deck is already delivering, and the desktop app does not notify for a daemon it cannot currently reach; if the system refuses a desktop notification, the app tries again. Restarting the TUI or the desktop app can send a still-waiting question's notification once more.

Limits:

- **Claude Code:** the deck can answer a question for about 24 days of waiting, the longest Claude Code keeps the deck's hook running; after that, answer it in Claude Code's pane. After upgrading the deck, restart the daemon or run `dot-agent-deck hooks install` so Claude Code's hook gets the longer wait.
- **Codex, OpenCode, Pi and Antigravity:** the deck sets no limit; it answers the question whenever you do.
- **An `agy` started from a shell inside a pane:** its card shows the permission prompt, but the deck offers no answers for it, in either client or by voice; answer it in the pane. Start `agy` as the pane's command to answer from the deck.
- **More than 64 questions waiting at once:** a question past that number still shows **Needs Input**, without the badge or the notification, and is answered in the agent's pane.

### Work left running after a turn

An agent can end its turn and leave something running: a command it started in the background (a dev server, a long build, a `sleep`), or a subagent that keeps working after the main agent has answered. A line under the card's status then says what is still running and for how long:

```
Background: 2 commands, 1 subagent · 3h 12m
```

- A kind with nothing running is left out (`Background: 1 subagent · 4m`), and the time is how long the oldest of them has been running.
- The line goes away by itself when the last of them ends, and while the agent is in a turn (after you send it a prompt) it is not shown.
- If the deck cannot tell how long something has been running, the line shows the counts without a time.
- In the TUI the line is on the card, under `Dir:`. In the desktop app it is in the agent's pane, under the agent's command and model, and on its tile on the Daemons screen, in the same words. The Dashboard row shows the status only.

What the status reads depends on when the agent started the command:

- **Waiting**, when a command it started in the turn that just ended is still running. The agent has handed that work off and its result is still to come, so the card does not read **Idle** yet. It turns **Idle** when those commands end.
- A turn the agent starts by itself to report finished background work is not a new turn here: Claude Code does this when one of its background commands or subagents finishes, and OpenCode when one of its background commands finishes. If the agent started three background commands and the first two finish, the turns that report them leave the card on **Waiting** while the third still runs.
- **Idle**, when everything still running was started in an earlier turn, or only subagents are still running.

So a command keeps a card on **Waiting** only until the agent's next turn ends, not counting those reporting turns. For example:

- A dev server the agent started in the background reads **Waiting** until it exits or the agent finishes another turn. If you do not want that, ask the agent to stop the server, or send it any prompt.
- If you send the agent a prompt while a command from its last turn is still running, and that turn ends with the command still running, the card reads **Idle** with the `Background:` line.

While a card reads **Waiting**:

- The agent can take a prompt or a message, as an **Idle** one can; sending one starts its next turn as usual.
- In the TUI its status dot does not blink and the terminal bell does not ring, because its work is not finished. The dot starts blinking when it turns **Idle**, and the bell rings then if you have the idle bell on ([Configuration](configuration.md#turn-the-tuis-terminal-bell-on-or-off)). A command started just before the turn ended can take up to a second to be counted, so when a turn ends the TUI waits about a second and a half before it blinks the dot or rings for **Idle**; a turn that ends as **Waiting** rings once, when it turns **Idle**. The stats bar counts it as `waiting`.
- Closing the agent with `dot-agent-deck close` is refused as busy unless you add `--force`, as it is for any card with work still running. A close sent within about a second and a half of an agent's turn ending waits out the rest of that time before it checks, so a card about to turn **Waiting** is not closed as finished. If the agent ends another turn while the close waits, it waits for that one too, for up to about four and a half seconds in all; an agent still ending turns after that is refused as busy, saying it kept ending turns.
- In the desktop app its mark is hollow, in the colour of **Working**, and the Dashboard's status filter offers **Waiting**.

A command that has been running for hours is easy to spot this way. To stop it, open the agent's pane and ask the agent to stop it, or stop it yourself in the pane.

What each agent reports:

| | Claude Code | Codex | OpenCode | Pi | Devin | Antigravity |
|---|---|---|---|---|---|---|
| Background commands | Yes | Yes | Yes | Yes | Yes | Yes |
| Background subagents | Yes | Yes | Yes | No | No | No |
| **Waiting** while a command it started in its last turn runs | Yes | Yes | Yes | Yes | Yes | Yes |

- On Windows, background commands are not counted for any agent; subagents still are. So no card reads **Waiting** on Windows.
- **Waiting** says only that the agent started the command in that turn and that it is still running, not that the agent will pick up its result by itself when it ends.
- An OpenCode subagent counts while its session is working, and stops counting when that session finishes, fails or is deleted.
- The deck's Pi extension and the Devin and Antigravity hooks do not report subagents, so a Pi, Devin or Antigravity card counts commands only.
- Until an agent has reported a status of its own, a command it runs can still turn its card **Working**, and no `Background:` line appears.
- A TUI or desktop app older than the daemon does not show the line and can show such a card as **Working**. With a daemon older than the app, cards behave the same way: a command left running turns the card **Working**, with no `Background:` line.
- A TUI or desktop app that shows the `Background:` line but not **Waiting** shows a **Waiting** card as **Idle** with the line. With a daemon that does not report **Waiting**, a newer app shows such a card as **Idle** with the line too.

### Blocked

In the TUI, a line under `Dir:` says which limit was hit and, when the provider says, when it resets. In the desktop app, the reason is shown in the agent's pane. The status stays until the agent shows it is working again (a new prompt, a tool call or a permission prompt from the main agent) or its pane restarts. There is no timer: a spent credit pool does not reset by itself. A subagent hitting a limit does not turn the card Blocked.

When a worker in an [orchestration](orchestration.md) that still owes a `work-done` turns Blocked, the daemon sends its orchestrator a one-time report, so the orchestrator can reassign the task or notify you; see [Idle Workers & Notifications](idle-workers-and-notifications.md).

If Blocked never appears for Claude Code or OpenCode, the hook or plugin that reports it may not be installed. The deck installs them when it starts, and again before it starts a Claude Code or OpenCode agent: OpenCode's plugin every time, Claude Code's hooks when they are missing or call a deleted copy of the deck. Claude Code's are written only once `~/.claude` exists, so if Claude Code had never run on this machine, restart the agent and its next start gets them. If Blocked still never appears, run `dot-agent-deck hooks refresh`, which says what it could not install, then restart the agent. On a remote host, run the same commands there.

## Message delivery

Both the TUI card and desktop tile show `✉N queued` for messages awaiting acknowledgement and `✉ delivered` when the agent has received them and none remain pending. On a TUI card this line sits in the top border beside the status. Where it would cut the agent's type and name short there, it moves to the right end of the card's `Dir:` row instead, and the directory is what gives way, so the title keeps the room it has without the line. On that row the line is bold, and a `✉` in the directory's name is shown as `?` and any text-direction control in it is left out, so the directory cannot pass for the line. A card that draws no `Dir:` row, such as a Minimal card whose Blocked reason takes that row's place, keeps the line in the top border. Narrow TUI cards shorten the line to the count, `✉N`, which does not say whether the messages are queued or the wake has stalled; where there is no count to show (`✉ delivered`) or not even the count fits, the card leaves the line out. A message that cannot be delivered shows **Error** (desktop **error**) and a `not delivered: …` notice. The desktop overview counts them under **ERROR**.

The `Prmt:` line on a TUI card shows `✉ <subject>` for a deck message. Its `Sent by:` line is visible in the agent's pane in both clients. Delivery means receipt, not that the task has finished. See [Orchestration → Delivery](orchestration.md#delivery-in-the-tui-and-desktop-app) for agent support and the inbox commands.

Long turns affect delivery in both clients:

- OpenCode and Pi can keep a message queued behind a busy turn without a not-delivered error during that wait, and do not receive another copy. Claude Code, with hooks from the same release as the deck, waits the same way: a message it has taken waits for its turn to end, and the deck neither sends it again nor reports it not delivered while the turn runs. A message that arrives during a Claude Code turn is held by the deck until the turn ends, for up to about a minute, so Claude Code takes it up as a task of its own. With older hooks the deck cannot confirm this wait, so a message waiting behind a turn longer than about five minutes can be reported not delivered before it arrives.
- A task reported as not delivered can still arrive, so check the agent's pane before posting it again. If it arrives after all, the orchestrator may be told, and the TUI card or desktop tile may leave its delivery error state once no other delivery error remains.
- A message Claude Code (with hooks from the deck's release), OpenCode or Pi has kept for an hour without starting on it shows a one-time reminder with **Retry** and **Cancel**; it is not an error, and the agent may still be working on it.

When the deck cannot tell whether a Claude Code, OpenCode or Pi agent got a message, the card or tile says `✉ delivery uncertain`; when a Pi agent has stayed idle for a few minutes without starting on a message the deck handed it, it says `✉ may not have reached the agent`. Both offer **Retry** and **Cancel**, except that a message the deck has already sent as many times as it allows offers only **Cancel**; post it again if it is still needed. Press `i` on the TUI card, or use the tile's buttons. [Orchestration → Delivery](orchestration.md#delivery-in-the-tui-and-desktop-app) explains what each choice does.

## What a TUI card shows

*This section is about the TUI. The desktop app's rows and columns are described on [Desktop app → Dashboard](desktop/dashboard.md#rows-and-columns).*

- **Title row**: the card number, the agent type, the pane's display name (or the session id if it has none), `QUESTION` and its age while the agent waits on a question ([When a question waits](#when-a-question-waits)), and on the right an animated dot and the status. The inbox line (`✉2 queued`, `✉ delivered`) follows the status while the whole title still fits beside it; see [Message delivery](#message-delivery) for where it goes otherwise.
- **`Dir:`**: the basename of the working directory, shortened with `…` when it does not fit, including to leave room for the inbox line at the right end of the row when that line has moved here.
- **`Background:`**: commands and subagents the agent left running after its turn ended, and for how long; see [Work left running after a turn](#work-left-running-after-a-turn).
- **`Prmt:`**: the most recent prompt or prompts.
- **Recent tool calls**: the last commands the agent ran.
- **`Last:` and `Tools:`**: time since the agent's last activity and its total tool-call count, in the bottom-right border. Narrow cards shorten them to `2m · 14 tools`, then `2m · 14`, and the narrowest omit them.
- **Pull request**: when the agent's branch has a pull request on GitHub, its number and glyphs for its state, its CI checks and its review, in the bottom-left border, for example `#1234 ⊙ ✓ ◉`. See [Pull request badge](#pull-request-badge) below.

The deck picks a density from how many cards it has to fit and the space available:

| Density | Prompts shown | Recent tool calls shown |
|---|---|---|
| Spacious | up to 3 | up to 3 |
| Normal | 1 | up to 3 |
| Compact | 1 | 1 |
| Minimal | none | none |

Minimal is used only when there are more cards than fit at Compact. Each card is then three rows: the title row, `Dir:`, and the bottom border with `Last:` and `Tools:`, so every card stays on screen instead of some being scrolled off. On a Blocked card the reason displaces `Dir:` when the card is too short to show both, and so do the `Background:` line on a card with work left running and `Orphaned — delegation unavailable` on an orphaned card. A Blocked or orphaned card that also has work left running keeps the reason on that row and adds the `Background:` line after it, separated by ` · ` (for example `⚠ Usage limit reached · Background: 1 command · 4m`), cut short with `…` when the card is too narrow for all of it. When even Minimal cannot fit every card, the deck goes back to Compact cards and you scroll with the selection keys (`j`/`k` by default); the title row then shows how many cards are above or below the window.

### Pull request badge

When an agent works on a branch that has a pull request on GitHub, its card shows the pull request on the bottom border, on one line: the number, a glyph for the pull request's state, a glyph for its CI checks and a glyph for its review. The glyphs and their colours follow GitHub's.

| Glyph | State |
|---|---|
| `⊙` | Open |
| `◌` | Draft |
| `◆` | Merged |
| `⊘` | Closed |
| `?` | A state this build does not know |

| Glyph | CI checks |
|---|---|
| `✓` (green) | All checks passed |
| `✗` (red) | At least one check failed |
| `●` (yellow) | Checks are still running, and none has failed |
| `?` | A result this build does not know |

The CI glyph is the pull request's overall result as GitHub's pull request list shows it, so a failing check that is not required for merging still shows `✗`.

| Glyph | Review |
|---|---|
| `✓` | Approved |
| `±` | Changes requested |
| `◉` | Review required |
| `?` | A review this build does not know |

The review glyph is drawn on a filled cell in its colour (green, red or yellow), and the CI glyph is not, so you can tell an approval from passing CI though both are a check mark: in `#1234 ⊙ ✓ ✓` the first check is CI and the filled one is the approval.

A pull request without CI checks shows no CI glyph, and one with no review yet shows no review glyph. On a narrow card the badge drops its glyphs, the review first, then CI, then the state, and keeps the number; the `Last:`/`Tools:` text shortens or goes first.

The badge appears by itself: an agent gets one when its working directory is a git repository with a GitHub `origin`, it is on a branch other than the repository's default branch, and that branch has a pull request. A merged or closed pull request counts only when the branch's latest commit is one of its commits, so a new branch that reuses the name of an earlier, deleted branch does not show that branch's old pull request; it shows none until its own is opened. It follows the pull request, so a review, a CI result or a merge shows up on the card within about a minute. Press `o` on the selected card to open the pull request in your system browser (the `open_pull_request` key in [Keyboard Shortcuts](keyboard-shortcuts.md)); if no browser can be opened there, as in a TUI on a remote host, the status line shows the pull request's address so you can copy it. On a card with no badge, `o` says the agent has no pull request. If you expect a badge and there is none, see [Troubleshooting → An agent has a pull request but no badge](troubleshooting.md#an-agent-has-a-pull-request-but-no-badge).

The desktop app shows the same pull request as a badge with icons on the agent's row and in its pane, and opens it inside the app when you click it; see [Desktop app → Dashboard → Pull requests](desktop/dashboard.md#pull-requests).

### Diagnostic markers on a card

| Marker | Where | Meaning | What to do |
|---|---|---|---|
| ` orphaned ` in the title, and `Orphaned — delegation unavailable` under `Dir:` | An orchestration role's card | The daemon that registered this pane's orchestration role was stopped or restarted while the agent kept running. The agent still works and reports status, but `dot-agent-deck delegate` from it is refused with `the daemon holds no orchestration role for pane …`. | Close the orchestration and start it again. See [Troubleshooting](troubleshooting.md#an-orchestration-stops-being-able-to-delegate-the-daemon-holds-no-orchestration-role-for-pane-). To avoid it, let `dot-agent-deck daemon stop` refuse rather than passing `--force` while an orchestration runs. |
| ` history ` in the title | A session the deck shows but does not drive, such as a Codex session run under `dot-agent-deck wrap` in another terminal | The deck shows its status but cannot type into it. | Type into it in the terminal where it runs. |
| ` view-only ` in the title | A session whose input channel this build does not recognise (for example, reported by a newer daemon) | The deck shows it but cannot deliver input to it. | Type into it where it runs, or upgrade this client. |

### Agents the deck did not start

*This section is about the TUI. The desktop app lists the agents the daemon started, so an agent you start yourself has no card there.*

An agent you start yourself, outside the deck, still gets a card when its hooks report to the deck. Antigravity is the exception: the deck's hook does nothing in an `agy` started outside the deck, so that `agy` gets no card. Such a card is removed when that agent's session ends, rather than being left behind as an empty card. The deck keeps up to 256 of these cards at a time: when another arrives beyond that, the one that has been quiet the longest is removed, and it comes back the next time that agent starts a session. Cards of agents the running daemon started never count toward that limit and are never removed to make room. An agent that kept running across a daemon restart was started by the previous daemon, so in a TUI you open after the restart it counts as one of these cards. A TUI that stayed open through the restart keeps the card it already had for that agent instead: the card keeps updating, does not count toward the limit and is never removed to make room, and when the agent's session ends the card stays and shows Idle, still marked orphaned if the agent belonged to an orchestration, rather than disappearing. A TUI older than the daemon leaves an empty card for the pane where one of these cards is removed.

## Check the machine a deck runs on

Before you start more agents on a deck, you can check how much room its machine has left. Both clients show the same figures for the machine the deck's daemon runs on. For a remote deck that is the remote machine, not the one you are sitting at.

The figures are the whole machine's, not any one agent's: they include everything else running on it, so they cannot tell you which agent is using the CPU or the memory. Neither client shows figures per agent. To see each agent run's CPU time and memory, and each worktree's disk use, run the collector on that machine; it sends them to your telemetry backend, and runs on Linux only ([Telemetry → CPU, memory and disk per run](telemetry.md#cpu-memory-and-disk-per-run)).

- **TUI:** in command mode, press `m` or `Ctrl+m` (the `host_metrics` key, which you can remap in `keybindings.toml`; see [Keyboard Shortcuts](keyboard-shortcuts.md)). The **Host of this deck** overlay opens over the dashboard and shows the deck the TUI is attached to. Press `Esc`, `q` or `m` again to close it. While it is open, its figures refresh every couple of seconds.
- **Desktop app:** each daemon's section on the [Dashboard](desktop/dashboard.md) has a small **Host** button beside the daemon's name. Its colour tells you at a glance how that machine is doing (see below), so with several daemons shown you can compare every machine at once. Click it, or reach it with `Tab` and press `Enter`, to open the **Host of this deck** figures; their **X** button, `Esc` or a click elsewhere closes them. With voice on, "show host" or "show resource usage" opens them too, and "close" or "close host" closes them ([Voice Control](desktop/voice.md#checking-a-daemons-machine)). The figures refresh at least every five seconds, and whenever the dashboard re-reads that daemon.

What it shows:

| Row | What it means |
|---|---|
| **Working root** | Free and total space on the disk holding the directory the deck's daemon was started in |
| **Worktree parent** | Free and total space on the disk holding that directory's parent, where sibling worktrees (for example `../<repo>-dispatch-*`) are created |
| **Temp root** | Free and total space on the disk holding the deck's test scratch directory |
| **Load per core** | The machine's one-minute load average divided by its CPU cores, and the core count. Around `1.00` or more means the machine is fully busy. |
| **Memory used** / **Memory available** | The machine's memory in use and still available |

A figure the machine cannot report reads `unknown`, never `0`.

### Warning and critical figures

The deck judges each disk, its load and its available memory against its own machine's totals, and both clients colour the figure by the result: green when it is fine, yellow (amber in the desktop app) for a warning and red when it is critical. A warning or critical figure is also followed by the word `(warning)` or `(critical)`, so you do not need to tell the colours apart. In the desktop app the **Host** button takes the colour of the deck's worst figure and says it, for example **Host: critical**.

| Figure | Warning | Critical |
|---|---|---|
| Disk (each row) | less than 15% of that disk free | less than 5% free |
| Memory available | less than 20% of the machine's memory | less than 10% |
| Load per core | above 0.8 | above 1.5 |

A figure that reads `unknown` is never coloured. A deck whose daemon is from a release that does not judge its figures shows them uncoloured, and its desktop button stays neutral.

You can change the limits for a deck in that deck's `config.toml`, on the machine its daemon runs on, under `[host_metrics]`. Each key is optional; a key you leave out keeps its default:

```toml
[host_metrics]
disk_free_warn_percent = 15
disk_free_critical_percent = 5
memory_available_warn_percent = 20
memory_available_critical_percent = 10
load_per_core_warn = 0.8
load_per_core_critical = 1.5
```

Or set one from the command line, for example `dot-agent-deck config set host_metrics.disk_free_warn_percent 20`. Percentages are from 0 to 100, and loads are 0 or more. A value that is not valid is ignored and that one limit keeps its default, which the daemon's log notes. A critical limit that is less strict than its warning resets both limits of that pair to their defaults, which the log also notes; `config set` refuses a value that would do that and names the other limit to change first. Changes apply within a few seconds, with no restart.

When a deck's daemon is from a release before this feature, or runs on Windows, the overlay and the desktop popover say **Host metrics are not available from this deck** instead of showing figures. Upgrade that daemon to see them (for a remote daemon in the desktop app, see [Daemons → Upgrade a remote daemon](desktop/daemons.md#upgrade-a-remote-daemon)).

## Resuming Sessions

*This section is about the TUI. The desktop app keeps no workspace of its own: it shows the agents the daemon has, and closing it leaves them running.*

To leave the TUI, press `Ctrl+c` in command mode (press `Ctrl+d` first if you are typing in a pane). The quit dialog opens, headed **Quit dot-agent-deck?**, with **Detach** selected. Move with `Up`/`Down`, press `Enter` to confirm, or `Esc` to cancel; each choice is also a button you can click:

- **Detach** (the default): the TUI exits and the agents keep running in the daemon.
- **Stop**: stops the agents and the daemon. While agents are running it asks once more first.
- **Cancel**: back to the dashboard.

The keys are in [Keyboard Shortcuts → Dialogs](keyboard-shortcuts.md#dialogs).

Every `dot-agent-deck` launch (and `dot-agent-deck connect <name>` for a [remote](remote-environments.md)) restores your workspace automatically. What comes back depends on whether the agents are still running:

- **They are still running** (you detached, or the terminal closed): the dashboard shows each agent with its live output and its current status, tool, tool count and recent prompts. An agent that was waiting for you shows **Needs Input** straight away.
- **They are gone** (a reboot, a fresh machine, or the daemon stopped): the deck recreates the workspace (panes, names, directories, commands and tabs) and starts each command again. It restores the layout, not the agents' conversations; use the agent's own resume option in its command, for example `claude --continue`. An agent that can be restored with its conversation ([Interrupted Work → Restore an agent](interrupted-work.md#restore-an-agent)) is not started again here: its pane is left out, and you bring it back from the Interrupted work list (in the TUI, `I` and then `s`; in the desktop app, the **Restore** button in the daemon's interrupted-work dialog), so it does not come back twice, once blank and once with its conversation. The deck leaves such a pane out only when the daemon answers with its Interrupted work list within a few seconds of the TUI starting; when it does not, the pane starts fresh like the others; with the [deck log](troubleshooting.md#enabling-debug-logs) on, it says why. Then close the fresh pane and restore the agent from the Interrupted work list: while the fresh pane runs in the agent's folder, Restore is refused because newer work is running there ([Interrupted Work → When something goes wrong](interrupted-work.md#when-something-goes-wrong)).

If there is nothing to restore, you get an empty dashboard. A pane whose saved directory no longer exists is skipped with a warning.

**Check:** after relaunching, the cards match what you left; `dot-agent-deck daemon status` lists the same agents.

### You come back where you were

The deck remembers which tab you were on and which pane was focused in each tab, including whether you were on the dashboard. When the agents are still running, reattaching puts you back on that tab and pane. A pane you closed in the meantime, or a role whose agent has finished, is not restored; that tab falls back to its start role. With nothing remembered (a first run), you land on the first orchestration tab if there is one, otherwise the dashboard.

When the agents are gone and the panes are recreated, only the tab is restored, not the focused pane.

The position is saved with the rest of the workspace, one per user account on the machine. If you run two TUIs at once, the one you close last decides what the next launch restores.

### Your setup stays up to date

The workspace is saved after every new agent, rename, tab change and agent change, and when you disconnect, so after an unexpected shutdown you come back to your latest setup.

### Orchestration tabs come back too

Orchestration tabs return with the orchestrator and its prompt, the role panes in their original order, and the start-role cursor where you left it. When the agents are gone and the deck starts the roles again, it starts only the roles that had a pane when the workspace was last saved. A role whose pane you had closed comes back as an empty card with nothing running in it; to start it, have the orchestrator run [`dot-agent-deck pane spawn <role>`](orchestration.md#commands). A workspace saved by an earlier version of the deck starts every role. If the project's `.dot-agent-deck.toml` has changed since (the file is missing, the orchestration was renamed or a role was removed), that orchestration is not restored and nothing from it starts; when you quit the TUI, it prints a warning naming the orchestration. Open it again from the New Agent form. Earlier releases restored such an orchestration as a plain dashboard pane running its saved command; that no longer happens, because the command would run without your approval.

When the agents are gone and the deck starts an orchestration tab again, it first checks that you approved that orchestration as its file now reads. For each one you have not, it shows **Review project commands** after restoring the rest: `a` restores the tab, `Esc` leaves it out. Nothing of it starts until you approve it, and approving it starts the same roles as above: those that had a pane when the workspace was saved. One you leave out, or have not answered when you quit, stays in your saved workspace as it was saved and is offered again next time; `dot-agent-deck snapshot clear` drops it. See [Approving Project Commands](project-trust.md#restoring-a-saved-workspace).

### Starting Fresh

To start the next launch from an empty dashboard, clear the saved workspace:

```bash
dot-agent-deck snapshot clear
```

It prints ``Cleared the local saved-session snapshot. The next `dot-agent-deck` startup will begin from an empty dashboard.`` It does not stop running agents, and the next launch still shows any agents the daemon is running; close them first, or quit with **Stop**, for a truly empty dashboard.

The saved workspace is `~/.config/dot-agent-deck/session.toml` (`DOT_AGENT_DECK_SESSION` overrides the path). `dot-agent-deck remote remove <name>` does not clear it.
