Docs / How it works

The embedded terminal, the agent modes and Agent tools

A right-hand column in the admin where Claude Code, Codex or a plain shell run in the instance, beside the drafts they make (track P49, decision 0027). Always on: there is no switch (P66, decision 0032, which reverses 0027 point 1); the guards below make it safe, and when no tab can start the column says why and how to fix it. This page owns the contract, the guards, the presets, the two agent modes and the Agent tools rows.

Switches (config/config.json, instance)

Key Default What it does
agent.default claude The CLI hub agent, the hub menu and the terminal's + start first (claude or codex); the order the automatic start (below) tries them in

A server restart (./run.sh up) applies a change. The permission mode has no key: every session runs with no prompts and the OS sandbox on (owner 2026-11-25); a leftover agent.unattended is read by nothing (files.config-keys WARNs naming it; delete it). The terminal has no key: a leftover terminal key is one nothing reads (files.config-keys WARNs naming it; delete it).

When it cannot start (P66)

terminalReadiness (@hub/terminal/readiness) is the one check, run by the server and by hub doctor row agent.terminal, so they cannot disagree. It counts only what stops EVERY tab, Shell included, each with its fix line: node-pty not installed in the core, or not loading on this Node (no prebuild, an ABI mismatch after a Node upgrade): pnpm --dir <core>/app install --frozen-lockfile; its spawn-helper not executable: chmod +x <path>; the shell a tab starts ($SHELL, else /bin/zsh) missing: set SHELL to an existing shell. A missing or signed-out CLI is not a problem (Shell starts; the quiet line under the tabs says it, P57). The server runs it at start (log line terminal: on (...) or terminal: cannot start: <reason> (fix: <fix>)), keeps the answer, checks a problem again at most every 5 s and on Agent tools' Refresh. While a problem is set, GET /api/terminal carries problem: {reason, fix}, POST /api/terminal/sessions and /ensure answer 503 {error, code: "terminal_unavailable", fix}, and the admin still draws the strip and the column: the column says the reason and the fix with a copy button, the + items are disabled with the reason, and nothing starts by itself. Never a dialog, never hidden.

The install workflow sets up what it can: node-pty's spawn-helper gets its execute bit from the server at start, from row agent.terminal's apply (./run.sh setup, hub install) and from hub core update after its pnpm install (a reinstall unpacks it without the bit). Doctor rows (group Agent, both run by setup and install, not audits): agent.terminal (the readiness above, FAIL with its fix; the API port on 127.0.0.1 only, FAIL otherwise; a running server with a problem, WARN with its reason) and agent.clis (one login-shell detection: each CLI's version and state with its install or sign-in line, and what opening the column starts; WARN when one is not ready, never FAIL, and nothing installs a CLI: npm i -g would write outside the instance).

The mode of a hub agent session, and who is there

hub agent <slug> [--cli claude|codex|shell] [--prepare] starts the session in the instance root, bound to one project, with the server's Node first on PATH. The terminal's presets run exactly this command, so a session is the same from Terminal.app and from the admin.

One permission mode, no switch (owner 2026-11-25: no friction):

Every session
Prompts none (Claude --dangerously-skip-permissions, Codex -a never with the hub's writing tools approved by name)
OS sandbox on: Claude's sandbox settings block (enabled, failIfUnavailable, allowUnsandboxedCommands: false, excludedCommands = ssh *, scp *, rsync * (P159), every domain allowed but loopback and the names known to resolve to it (LOOPBACK_HOSTS, 3l), local binding allowed, denyWrite on the protected paths); Codex: the hub permissions profile
Network from commands Claude: open since 3l (P147), every host but LOOPBACK_HOSTS, so the send route and the API stay out of reach; Codex: open since P159, loopback included (see below)
SSH (P159, owner 2026-11-26: always) both: ssh, scp, rsync over ssh reach any host with the owner's own ~/.ssh (config, known_hosts, keys, ControlMaster). Claude runs them outside the sandbox; Codex runs them inside, on its open network
MCP servers (mail-mcp, Notion, hub) work unchanged: the CLI calls them outside the sandbox
Send tools off, strict MCP, deny rules, guard hook (Claude) or forbidden rules (Codex) yes
Send policy server-owned (S11), manual send needs a ticket (S12) yes

Never: Codex --dangerously-bypass-approvals-and-sandbox or --yolo (codexArgs throws, hub doctor fails on a config that sets it). The sandbox is the guard.

Attended or not comes from how the session started, never from the mode (decision 0046). A session the owner starts (the dock, a terminal, a resumed session) is attended: messenger_send on his word, client_create, chat_link, any known chat of the project. A background run the Hub starts itself (an autopilot turn, a follow-up sweep turn) is not: its runner sets HUB_AUTOPILOT_CHAT or HUB_FOLLOWUP_CLIENT on the turn's hub mcp (backgroundRunOf of @hub/config/follow-ups), the turn has its own bound tools and no send. A link a client sent is opened with link_fetch of hub mcp (a public http(s) URL only, never localhost, a private address or file:; an image comes back as image content).

Protected paths (read-only in the sandbox, Edit deny rules in every mode, because Claude's Edit and Write tools are not sandboxed): state/projects/ (the send policies and session files), state/autopilot.json (the instance's autopilot switch, decision 0048), state/secrets/ (unreadable), state/codex/, config/config.json (the allow-list) and config/mcp.json, the core's live checkout (entry by entry since P159 part 2: its git dir and a worktree folder beside it are writable, below), run.sh, .claude/, .codex/, .mcp.json. Since 3l (P147, owner 2026-11-25: full access by default) the rest of config/, the instance's .git, CLAUDE.md and AGENTS.md are writable; what stays read-only is what holds the session's own permissions and guards. Claude also gets state/log/ (the agent session log, 25-agent-log.md): its hooks write it, the agent cannot. Reading and editing besides the protected paths (P140 K3, the owner's decision of 2026-11-24, skills/README.md "Reading and writing files"; denyRules of @hub/agent/deny): a session reads and edits projects/**, other projects included; reads the database folder and the other tabs' drops but never edits them; and still neither reads nor edits state/secrets/, another project's session files or its Codex home (they hold that project's capability, P112 S3). The guard (auditToolCalls) warns on an Edit in another project's folder and says nothing on a Read or Grep there; a knowledge tool stays bound to the session's project. The database folder stays writable so draft_write's record works inside the sandbox; draft_write's record loads only its own project's folder.

Codex has no strict-MCP flag, so each project gets its own CODEX_HOME: state/codex/<slug>/ with config.toml (the hub's MCP servers only, disabled_tools per server, the hub profile: ":root" = "read", ":workspace_roots" = "write", the protected paths "read", secrets and other projects' session files under state/projects/<other> and Codex homes (P112 S3) "none", other projects' folders and the other tabs' drops "read" (P140 K3), network enabled = true (P159), ~/.ssh "write" and the owner's other token files "none" (codexOwnerAccess), the Notion server's enabled_tools = the allow-list (P112 S3: Notion is default-deny); the project trusted; the owner's model and model_reasoning_effort carried), rules/hub.rules (hub send, the API and loopback as forbidden prefixes), skills/ (links to the core skills) and auth.json (a link to the owner's, never a copy). A remote MCP server that needs OAuth (Notion) signs in once per CODEX_HOME.

The owner's own token files (3l, P147): an attended session can read the instance (state/secrets/ excepted) and the owner's home, except the fixed list OWNER_SECRET_FILES of @hub/agent/session (the Google connector's config, the Notion and OpenRouter keys, ~/.ssh, ~/.aws, ~/.netrc, ~/.git-credentials, ~/.config/gh, ~/.npmrc, ~/.docker/config.json): each is both a Read deny rule and a sandbox denyRead (Claude); in Codex's profile each is "none" but ~/.ssh (P159, below). ~/.zshrc stays readable; the skills' rules say a key is never copied out of it. Background runs keep the tight profile.

Since 3l (P147, 2026-11-25) Claude's commands reach every host but LOOPBACK_HOSTS; the proxy normalises IP spellings before the deny, so a decimal IP to loopback stays refused (from the code, not yet re-measured), but another name that resolves to 127.0.0.1 reaches the admin (the owner's decision). Measured on Claude Code 2.1.220 and Codex 0.146.0 (2026-11-18), in the sandboxed mode, in a scratch instance: a decimal-IP curl to the send route exits 7 in both; osascript to Mail fails in both; echo >> the policy file is refused by the OS in both; Claude's Edit and Codex's apply_patch on it are refused; draft_write's record works. Another CLI version is a WARN in Agent tools: rerun those checks.

SSH, always (P159, owner 2026-11-26: «Надо разрешить агентам доступ по SSH обязательно… Всегда»). Measured on Claude Code 2.1.220 and Codex 0.153.0 (2026-11-26), in throwaway sessions built from the generated files: ssh -o BatchMode=yes host 'echo ok' prints ok in both, scp and rsync copy a remote file. Before, both failed with connect … port 22: Operation not permitted.

Improving the core (P159 part 2, owner 2026-11-26: «Надо убрать сэндбокс, чтобы наш агент мог спокойно работать с Core Reforms Hub… улучшать общие инструкции, скиллы»; the coordinator's delegated decision). The live checkout (the instance's core link) is what the server and every session read, so it stays read-only; an attended session works in a worktree in <core>-dock/<topic> (one folder beside the core, derived from paths.core: coreAccess of @hub/agent/core-access). The steps the agent follows are in skills/README.md ("Improving the core") and the capabilities line's core part.

The third kind: an autopilot turn (decision 0048, P139 A3)

The server, not the owner, starts it: one headless claude -p per client burst in a chat whose three autopilot switches are on (packages/agent/src/autopilot). It runs the Hub's own Claude Code (beside the Hub's Node, never one from PATH) on the owner's Claude sign-in (his plan, no key; USER must be set, A0), model sonnet, --max-turns 12, killed after 120 s, at most 2 at once and 100 a day on this Mac. Its files are per chat under state/projects/<slug>/autopilot/<chat>/ (a protected path): a settings file with no hooks (disableAllHooks: the prompt hook would log its prompt as the owner's words), the advisor off and the folders' memory files excluded; an MCP file with only hub, bound to the project (its capability) and to the one chat (HUB_AUTOPILOT_CHAT). Flags: --tools "" (no built-in tool at all, so no shell and no sandbox to set), --disallowedTools for every other hub tool, --allowedTools and --permission-mode dontAsk for its five (messenger_history, client_show, knowledge_search, knowledge_get, messenger_draft_write), --strict-mcp-config, --no-session-persistence, the autopilot-reply skill as its appended system prompt, and the prompt (facts only, no client text) on stdin. Env: USER, HOME, PATH, MCP_CONNECTION_NONBLOCKING=false, CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1, nothing of the server's HUB_*. It reads stream-json: the init event must show hub connected with exactly the five tools (else the turn is refused, mcp_not_ready); the draft is the one its own messenger_draft_write call wrote and the hub answered; is_error and any permission denial fail the turn. An e2e run uses HUB_AUTOPILOT_BRAIN=fake (only with HUB_DB); a test or a throwaway database gets no brain. Unmeasured: whether disableAllHooks in --settings also silences hooks of the owner's own ~/.claude/settings.json in print mode, and a full turn from the launchd-started server.

The fourth kind: a follow-up turn (decision 0050, P142)

The server starts it too: one headless turn per silent client of the daily sweep, through the same runner as an autopilot turn (the same binary, sign-in, env, --tools "", --strict-mcp-config, --max-turns 12, 120 s, and one of the same two slots, an autopilot turn first), with the follow-up-sweep skill as its system prompt and hub bound to the project and to the one client (HUB_FOLLOWUP_CLIENT, the clients row id; another client is refused followup_other_client). Its nine tools: client_show, client_map, message_show, knowledge_search, knowledge_get, draft_write, messenger_draft_write, follow_up_plan, bug_report (P145); no send tool. The init event must show exactly those (else mcp_not_ready). At most 60 such turns a day on this Mac, apart from autopilot's 100. An e2e run uses HUB_FOLLOWUP_BRAIN=fake (only with HUB_DB). Everything else: 30-follow-ups.md.

A follow-up turn bound to a fixed bug's note (P145 B4) also carries HUB_FOLLOWUP_BUG_NOTE, the bug_fixed_notes row id: its draft is stamped on that note, and a mail note joins the day's lead batch (30-follow-ups.md "Bug reports").

The fifth kind: a pass turn (decision 0055, P147)

The server starts it too: one headless turn per open lead (the lead pass) or per sender's newest open message (the mail pass), through the same runner and slots as a follow-up turn. hub is bound to the project and to that one lead (HUB_LEAD_PAGE, the page id) or that one inbound row (HUB_MAIL_INBOUND); another is refused. Its eight tools: knowledge_search, knowledge_get, client_show, message_show, link_fetch, draft_write, lead_decide or mail_decide, bug_report (LEAD_PASS_HUB_TOOLS, MAIL_PASS_HUB_TOOLS); no send tool. The rules are the lead-pass skill, or triage-mail's references/mail-pass.md. Each turn ends in one decision; a reply is a draft in the day's lead batch, sent only by the owner's Send all ready. At most 30 turns a pass and 60 a day on this Mac for both passes. Everything else: 21-leads.md "The daily passes".

Send policy and send ticket

state/projects/<slug>/send-policy.json replaces the draft.recipients and send.* rows of project.md; hub send policy is the one writer (16-projects-and-knowledge.md section 3B). Its optional autopilot block (decision 0048, P139: mode off, dry_run or on, the chats switched on, disclose, quiet) is written through the same writer by the owner's routes (PUT /api/projects/:slug/autopilot, a ticket from POST /api/autopilot/tickets bound to autopilot:project:<slug>) or hub send policy autopilot <slug> mode|chat|disclose ... in his own shell, which refuses inside a session. The instance switch state/autopilot.json has its own route (PUT /api/autopilot, ticket autopilot:instance). POST /api/sends/tickets {project, draftId} mints a single-use ticket (60 s, bound to send:<draftId>) for the admin's exact origin with Sec-Fetch-Site: same-origin; the apply step of POST /api/projects/:slug/drafts/:id/send needs it, else 403.

The terminal: contract

Wire shapes: @hub/contract/terminal. Server: @hub/terminal (sessions, PTY, presets, env, socket; imported by apps/server only) and apps/server/src/terminal/terminal.ts, routes/terminal.ts.

Route What it does
GET /api/terminal {presets, sessions, clis, checkedAt, problem} (clis: the detector's facts, below; no path; empty until the first detection finished; problem: null, or why no tab can start with its fix, above)
POST /api/terminal/sessions {preset: "claude" | "codex" | "shell", project?} (strict: no command, no path). 201 with the session; 400 an unknown preset or a CLI without a project, 404 an unknown project, 409 at 8 live sessions, 503 terminal_unavailable while a problem is set. Exact admin origin and Sec-Fetch-Site: same-origin (P57)
POST /api/terminal/ensure {project?, theme?} (P57): the running session of that project (200, created: false), else the server's pick starts (201, created: true, why: the one line when the pick was not the first choice, or that it resumed); P64: the pick resumes the project's last logged session when it can (below). One at a time per project, so two tabs get one session; 503 terminal_unavailable while a problem is set. Exact admin origin and Sec-Fetch-Site: same-origin
DELETE /api/terminal/sessions/:id Closes the tab: SIGHUP to the process group, SIGKILL after 3 s
POST /api/terminal/sessions/:id/drops P76, decision 0041: a multipart body of 1 to 10 files (field file), 20 MiB in all; each is written to state/drops/<project or _shell>/<session>/<safe name> (hubPaths().drops; the basename only, letters, digits, ._-, at most 80 characters, -2 on a clash; folders 700, files 600, never overwritten) and the answer is {paths}, absolute, in the order sent. The dock pastes them into the session (below). 404 an unknown session, 409 an ended one, 400 no file, 413 past the caps; exact admin origin and Sec-Fetch-Site: same-origin, no ticket (it types nothing). The folder is removed when the tab closes and when the server stops; the server empties state/drops at start
POST /api/terminal/tickets {session}: a single-use ticket (30 s, bound to term:<id>) and the socket URL ws://127.0.0.1:<api port>/terminal; exact admin origin and Sec-Fetch-Site: same-origin
upgrade /terminal straight to the API port (not through Next's rewrite). 404 for another path, 400 with a query string (a ticket in a URL is logged), 403 for a Host that is not loopback or an Origin that is not the admin's

Socket: the first frame is {op: "auth", ticket} within 2 s, else close 4401 (4404 when the session is gone); then ready, a snapshot of the screen (@xterm/headless 5 000 lines, serialised), then the live stream. Bytes are binary frames both ways; control is JSON (resize clamped 2 to 500, ping/pong; exit, taken). One viewer per session: a second attach takes it and the first closes 4409. Output is batched at 16 ms; the PTY pauses above 1 MB queued in the socket and resumes under 256 KB.

Presets, a fixed server table: claude and codex spawn the argv <server node> <hubBin> agent <slug> --cli <x> through the owner's login shell for its environment ($SHELL -l -i -c 'exec "$0" "$@"' <argv>): nothing is typed into a prompt and no string is parsed, so a key pressed while the shell starts cannot corrupt the command (v0.9.1 typed it and a first key leaked in: zsh: no such file or directory: д<path to hub.mjs>); the tab ends when the CLI exits. shell is the owner's own login shell (not sandboxed, as in Terminal.app). Without a project in the admin URL only Shell is offered (a one-project instance always has its project, P57). The shell is $SHELL -l -i in the instance root; env: the server's minus HUB_MAILER, HUB_DB, HUB_PORT, HUB_CONNECTIONS_PROBE, HUB_TERMINAL_SHELL, HUB_AGENT_TOOLS, NODE_OPTIONS, plus HUB_HOME, HUB_PROJECT, TERM=xterm-256color, COLORTERM=truecolor, UTF-8 LANG, TERM_PROGRAM=hub, and COLORFGBG for the admin's resolved theme when the tab starts (0;15 light, 15;0 dark). The screen's colours are the --terminal-* tokens of the current theme, re-read live, and xterm answers a program's OSC 10/11 colour queries with them, so Claude Code and Codex can match their palette; the owner's own CLI settings (Claude's /theme) are never changed. Sessions end with the server; closing the column or the page only detaches.

The terminal starts itself (P57). @hub/agent/detect detectClis() has two tiers. Tier 1 resolves each CLI on known folders (the server's own node folder, which the LaunchAgent pins; then the server's PATH; then ~/.local/bin and ~/.claude/local) and runs its --version and claude auth status --json / codex login status directly, in parallel, each cut at 10 s (measured 2026-11-19 under a launchd-like environment: 1.7 s, both ready). Tier 2, only for a CLI tier 1 did not settle (not found, --version fails, sign-in not read), is ONE spawn of the owner's login shell ($SHELL -l -i -c <script>, the environment a tab gets; stdin closed, the process group killed at 45 s): command -v, --version and the sign-in, each fenced by marker lines so a profile's output is ignored. Why both: under launchd (P67, v0.12.12) the login shell (conda, nvm and brew in the profile) did not answer in the old 15 s, so both CLIs read unknown for as long as the server ran; and the non-login PATH can name another codex (a broken nvm v22.11.0 one) than the login shell (v22.22.0, 0.146.0), so a binary that does not start is never tier 1's answer, it falls through to the login shell. A fact is ready (found, --version answers, signed in), signed-out, missing (not found, or --version fails) or unknown (the shell hung or said nothing), with its one fix line: INSTALL_LINE (npm i -g @anthropic-ai/claude-code, npm i -g @openai/codex) or LOGIN_LINE (claude auth login, codex login), the same lines the launcher and Agent tools say. The server keeps the answer in memory (cliDetector: one run at a time; all ready kept 10 min, anything else 60 s), detects in the background at start, again when any terminal session exits (he may have signed in or installed inside it), on Agent tools' Refresh, and when GET /api/terminal finds a stale answer with an unknown CLI (in the background: the read never waits; a missing one is not re-detected per minute, it would run the login shell each time); ensure waits at most 8 s for a detection, then picks from the last answer; the doctor detects fresh. HUB_TERMINAL_SHELL=fake or HUB_AGENT_TOOLS=fake answer both ready. pickPreset decides what an automatic start runs: the first READY CLI in agent.default's order; else Claude Code installed but not signed in (its first screen is its own sign-in); else Shell (Codex not signed in is never picked by itself: its sign-in inside the generated CODEX_HOME is untested); unknown facts keep the config order; no project: Shell. The admin calls ensure when the column becomes visible (the strip, Ctrl+, the phone's button, or a column restored open from storage once the page is visible), once the shell knows the address's project (v0.12.10: a column restored open after a restart read the terminal state before the projects and started Shell with no project), and no session of that project runs, at most once per project per page load; a collapsed strip on page load starts nothing, a crashed start is never restarted. When the pick was not the first choice one quiet line under the tabs says why, ending in the fix with a copy button ("Codex: Claude Code is not signed in · claude auth login"). The +` menu stays the switch: a CLI not installed is disabled with its reason, one not signed in says so and still starts. On a one-project instance the terminal has that project on every route (Connections included); with two or more, Overview and Connections keep Shell only. The memory of one idle session (Claude plus the stdio MCP servers it spawns) is not measured yet.

After a reboot (P67, decision 0033). The instance's LaunchAgent starts the server at login, so the strip is there without a terminal; nothing starts in it until the column is opened (P57: a collapsed load starts nothing, and the agent opens no browser). Shells of the dock then run under launchd's job, a different responsible process from Terminal.app for macOS privacy prompts (Automation to Mail, folder access): the owner allows each once.

The automatic start resumes the project's last session (P64). After a restart (hub up) ensure does not start a blank agent: it asks @hub/log/resume chooseResume() for the picked CLI's last session of THAT project in the session log (state/log/<slug>/, P54): the newest by its last event within 24 h (RESUME_MAX_AGE_MS, a constant), with at least one prompt (the idle session an earlier automatic start left is skipped), a transcript the log named that still exists, the same project and cli on the events, and for Codex a rollout inside state/codex/<slug>/. Found: the argv gets --resume <uuid> (hub agent <slug> --cli <x> --resume <id>, still a fixed argv; presetArgv refuses anything but a UUID), the tab title ends in "· resumed", and the quiet line says "Resumed the Claude Code session of HH:MM (8d31964d). + starts a new one."; else a fresh start as before. The + menu (heading "New session", POST /api/terminal/sessions) never resumes. The launcher checks the id again against the log (hub agent --resume typed by hand gets the same isolation) and starts fresh with one line when it cannot; a resume whose CLI exits non-zero within 15 s (an unknown id: Claude "No conversation found", exit 1 in about 4 s; Codex "no rollout found", exit 1) gets ONE fresh start, said in one line; a resumed session that ran longer is never restarted. hub agent / hub agent continue resolve the bound project's last logged session the same way (no cut-off): the hub never passes Claude's --continue or Codex's resume --last, because every project's session runs in the instance root and --continue takes that folder's newest conversation, whichever project it was. Safety, measured 2026-11-19: Claude 2.1.220 applies every flag of the resuming process (--settings with its deny rules and hooks, --strict-mcp-config --mcp-config, --disallowedTools, --append-system-prompt), keeps the session id and the context; a resume is a new process, so it gets the current settings' hooks. Codex (measured on 0.153.0) re-reads config.toml on resume (a sandbox change applied) but keeps the developer instructions the session STARTED with (the hub's binding prompt, session rules and project identity): so a Codex session is resumed only when its rollout's first developer message equals sessionInstructions() now, else fresh ("Codex keeps the rules a session started with ..."). Not handled: a session still open in another terminal (Terminal.app) can be resumed a second time by the dock.

node-pty 1.1.0 (the one native dependency) ships prebuilds/darwin-*/spawn-helper without the execute bit under pnpm; the server sets it at start (ensureSpawnHelper, P66), agent.terminal's apply and hub core update set it too, and the doctor row checks it. Tests: HUB_TERMINAL_SHELL=fake runs app/test-support/fake-shell.mjs and is refused without HUB_DB.

Open in Claude Desktop is not offered (P61 section 9, owner item 7). Claude Code's /desktop (and claude --desktop --resume <id>, Claude Code 2.1.285 or later) would continue a dock session in the desktop app, which starts its own process without any of the hub's rules (no deny list, no guard hook, no strict MCP set, no binding prompt; the claude.ai connectors, Gmail send_message among them, reach it directly): decision 0011 would not hold there. So the registry declares agent.openInDesktop with offered: false: the handoff row of the tab's tips (below) shows the button disabled with its reason on a Claude Code tab ("Not offered: Claude Desktop would run this session without the hub's rules") and on a Codex tab (the ChatGPT app keeps its own sessions and settings), none on a Shell tab or off macOS; POST /api/local/agent.openInDesktop answers 501 with the same sentence and hub open agent.openInDesktop exits 2. Nothing runs claude --desktop, writes into the PTY or opens a claude: link; claude --desktop, codex app, hub open and a bare open are in the deny rules and Codex's forbidden prefixes. The owner may still type /desktop himself, knowing what it drops.

Tips per tab (P63 patch B). Beside Close, an ⓘ button ("Tips for Claude Code", "Tips for Codex", "Tips for the terminal" on Shell) opens a popover like ?: the open tab's CLI's tips and the Hub's own, from the one list @hub/contract/tips (Help shows all of them, grouped). Claude Code: /voice (hold Space to speak, /voice tap, /voice off; a claude.ai sign-in, not an API key; not yet tried in the dock, where macOS asks for the microphone for the app that started the Hub), /resume (its list shows every project's conversations: pick this project's), /desktop (not offered, why, and the disabled button). Codex: the last conversation comes back on opening, /app (not offered). The Hub: "ответь" / "перепиши короче" on the draft on screen, ⌘ Enter saves an edit, Hide stops nothing. Each CLI row carries verifiedOn, the version its keys and commands were checked on (its --help, the slash-command table in its binary, its docs; Claude Code 2.1.220, Codex 0.153.0); hub doctor --only Agent row agent.tips (an audit) warns when an installed CLI is newer, so the rows are checked again after an upgrade. Nothing in the popover types into the session.

The column's width, its keys and its tab (P88, research 27). The column opens at 400 px (DOCK_WIDTH.default in @hub/ui/product/side-dock), so at a 1280 px window the screen beside it keeps Mail's list and card side by side (the list-detail splits from 768 px of its own width); the owner's drag is saved and wins, Home or a double click on the separator comes back to 400. A press on the column while a page menu is open lands on that menu's backdrop (Base UI menus are modal): the dock moves focus into the open tab's terminal, so the menu closes without taking focus back and the next keys go to the terminal (useMenuHandoff in features/terminal/terminal.tsx). A lone Enter that follows a chunk of text (a paste, dictation, a typing tool) by less than 250 ms is held until then (enterPacer in @hub/ui/product/terminal/keys.ts), since Claude Code likely reads an Enter inside its paste window as a new line (the cause is inferred from research 27 B7, not reproduced against a real session). The dictation footer uses Meta/Ctrl+D, sends the accumulated transcript with Enter, and defaults to the browser's first supported language; an explicit choice is persisted by the shared UI terminal storage seam and never read during the first render. A column restored open after a reload shows the tab he had open (terminal-tab) when it is one of the project's sessions, and only otherwise the project's running one.

Drop a file on the terminal (P76, decision 0041). A browser never hands over a dropped file's path (a Finder drag reaches Chrome as types: ["Files"] only), so the dock copies the file into the instance and pastes that copy's path. While a file drag is over the open tab's terminal (@hub/ui/product/terminal, drop.ts classifies the drop) the box shows a ring and "Drop to paste the path"; on drop the session pane checks the count and size (10 files, 20 MiB: the line names the file and the limit, nothing is pasted), posts the files to the drop route above, and pastes the answer through xterm's paste: each absolute path, bare when it has only letters, digits and ._/@+-, else backslash-escaped as Terminal.app types it, one space apart and one space after, so he keeps typing and nothing is sent before Enter. The pane's status line says "1 file pasted" or why not. Dropped text or a URL is pasted as text (C0 controls other than tab and newline removed, at most 100 000 characters), no request. A folder is refused ("Folders are not taken: drop the files, or a zip of the folder."). A file dropped anywhere else in the admin is swallowed by the shell frame's guard (features/shell/use-file-drop-guard.ts, file drags only, so a text drag into an input still works) and never opens in the tab. Whether Claude Code or Codex turns a pasted image path into an attachment is theirs; either way the path is text the agent reads with its tools. A session of another project cannot read the folder (deny rules, the Codex profile).

Guards (threat: a web page in the owner's browser)

# Guard
S1 No switch since P66 (decision 0032): the terminal is always on, and S2 to S8 are unconditional. Until P66: off by default, off = 404
S2 The listener binds 127.0.0.1
S3 Host must be a loopback name (DNS rebinding)
S4 Exact admin Origin (http://127.0.0.1:<admin port> or localhost), a missing or null Origin refused, on the upgrade, the ticket, the new-session, the ensure and the drop routes (the last four also need Sec-Fetch-Site: same-origin)
S5 A ticket, not a cookie (cookies are not port-isolated); in memory, so a restart voids them
S6 No CORS header anywhere; no state change on GET
S7 Presets only: no route takes a command; the slug is checked against the registry. The one route that takes a file name (the drop, P76) keeps only a safe basename and writes it under a folder the server names (state/drops/<project>/<session>/); no route takes a path
S8 XSS in the admin equals a shell: no dangerouslySetInnerHTML in apps/admin or packages/ui (rules test); terminal links open through lib/external.ts with noopener; they stay outside the Open registry (P61, @hub/contract/local) on purpose: a terminal prints arbitrary hosts, which a fixed table cannot list, and they open a browser tab, not an OS program
S9 to S12 The sandbox, send tools off, the server-owned send policy, the send ticket (above)

Shared focus: the agent sees what the owner sees (P51, decision 0029)

"Ответь этому клиенту" or "ответь по этой записи" in the dock needs no explanation: the session knows what the admin shows, on every screen.