# Claude Code sessions



Cluster Build can run an installed **Claude Code** as a
native agent. Claude Code keeps its own login, model calls, tools, project
instructions, configuration, and native history; Build provides the terminal,
an account-bound transcript, and the session lifecycle. With
[remote control](/docs/build/interactive#remote-control) on, your other devices
can also start Claude Code sessions on this machine.

```bash
claude auth login
cluster --agent claude
cluster exec --agent claude "Explain this repository"
cluster exec --agent claude --model claude-sonnet-4-6 "Explain this repository"
cluster exec --agent claude --json "Explain this repository"
cluster resume <build-session-id>
cluster exec --resume <build-session-id> "Continue"
```

Install and sign in to Claude Code separately. Build still requires workspace
trust and a Cluster login to own the transcript, but never passes Cluster
credentials, tools, project instructions, or memory to Claude Code. Claude
Code's own credential variables, such as `CLAUDE_CONFIG_DIR`,
`ANTHROPIC_API_KEY`, and `CLAUDE_CODE_OAUTH_TOKEN`, are passed through. Build
doesn't require a specific Claude Code version; if the installed version isn't
compatible, the session fails with an error before it starts.

## Permissions [#permissions]

The startup banner and `/status` show the session's execution policy. New Claude
Code sessions default to **Ask**. Remote clients offer three permission modes:

* **Ask** uses Claude Code's default permission mode; native allow rules still
  apply, and you review requests that require approval.
* **Auto** uses Claude Code's automatic approval review.
* **Full access** runs commands and edits without approval prompts.

Build doesn't add its own sandbox. Foreground-only tools and the fixed workspace
still apply in every mode.

The host confirms and saves the selected mode, restoring it after reconnect or
host restart. Changing modes interrupts active work and cancels pending approvals;
interrupted commands are never replayed. If a change can't be applied or saved,
the native process closes; reconnect to restore the saved policy.

* Bash requests use Build's command approval. Other tool requests show the
  tool, workspace, and full input with **Allow once** and **Deny**; `Page Up`
  and `Page Down` scroll long inputs.
* Approvals apply to that request only and never add new allow rules.
* Questions with one to three prompts of two or three choices each use Build's
  question UI. Multi-select and other question shapes are refused.

Questions still require answers in every mode. Headless runs refuse any request
that needs an answer; Build never supplies an approval automatically.

## What runs [#what-runs]

Foreground tools and foreground subagents work; a subagent's own messages stay
in Claude Code's history, and its result appears in Build. Background tasks,
scheduled tasks, and worktree switching are turned off, and each Bash command
starts back in the session's workspace. Organization-managed Claude Code
settings that conflict with these rules are refused before your first message.

## Interrupting and exit codes [#interrupting-and-exit-codes]

`Esc` interrupts the turn and clears queued input; partial output stays in the
transcript. Quitting the session stops Claude Code.

`cluster exec` exits `0` for success, `1` for failure, and `130` for an
interrupted turn. With `--json`, the result includes the Build session ID,
native model, text, `stopped_early`, and `backend: "claude"`.

## History and resume [#history-and-resume]

Build keeps its transcript in `~/.cluster/sessions`; Claude Code keeps its
native history in its own configuration directory. Deleting a session in Build
doesn't delete Claude Code's history.

Resume picks the saved backend automatically and requires the same machine,
workspace, Claude Code login, model, and native history. If the native history
is missing or changed, resume fails instead of starting a replacement; the
Build transcript stays readable.

## Edit a message on mobile [#edit-a-message-on-mobile]

In a remote Build chat, wait for Claude Code to finish, then select
**Edit message** on one of your messages. You can revise the prompt and its
attachments in the composer. Opening or canceling the edit leaves both
histories unchanged.

Sending the edit replaces the selected message and everything after it in the
same Build chat. Claude Code continues from the history before that message. If
you edit the first message, the replacement starts with an empty native history.
The original Claude Code history is preserved separately.

## Limitations [#limitations]

Sessions accept [images and documents](/docs/build/interactive#native-agent-attachments)
from clients that support attachments.

Not available: steering, plan mode, compaction, Cluster tools and
MCP, goals, forking into a separate Build chat, and changing the model within a
session. Interactive sessions use the model configured in Claude Code;
`cluster exec --model` picks one for a new headless session.
