Install a Claude Code worker
Status: Ready
Article ID: 042
Truth label: Current
Audience: Fleet operator
Reader outcome: Register an authenticated worker that advertises and executes the Claude Code backend.
Related articles: 010, 041, 047
Target week: 17
Last verified: 2026-09-13
Technical reviewer: Codex source audit
Editorial reviewer: Codex editorial audit
Prepare the host
Install the project environment and the Claude CLI on the worker host. Complete
the CLI's interactive login as the same operating-system user that will run
the worker. Confirm the claude binary is on that process's PATH without
printing credential state.
Configure Central and Brain URLs, the shared API token when required, and a
private worker data root. Use a stable --name if more than one worker can run
on the host.
Start with bounded authority
Start the module with --engine claude-code, an explicit default permission,
and an explicit maximum permission. On startup, the worker prints a banner
announcing its permission ceilings, supported path flavors, and discovered
CLI versions. Registration advertises claude-code alongside its probed
version string so Cortex can display fleet versions in the Overview panel.
Operators can inspect and upgrade installed CLIs on the box using
scripts/upgrade-clis.py.
The adapter maps safe to plan mode, write to accepted edits, and yolo to skipped permission checks. Keep yolo off trusted production work unless its machine-level risk is explicitly accepted.
Understand the output contract
Claude runs in headless stream-JSON mode with no turn cap: agent turns are
unlimited, and the adapter passes no --max-turns. The adapter parses the
final result event, success subtype, turn count, cost, usage, model details,
changed files, and CLI session id. It can resume a prior session when the id
still exists, and it accepts a reasoning effort from low to max.
Progress events become bounded task logs. The final Central state still depends on result authentication, fencing, verification, and supervision.
Prove the installation
Create one read-only synthetic task pinned to the new worker. Confirm the returned assignment, claimed engine, session id, lease renewals, verification result, and terminal disposition. Then inspect the worker credential file's permissions without displaying its contents.
Current limits
CLI login, PATH, and session storage belong to the host account. A worker started by a supervisor may have a different environment from an interactive shell. Claude plan mode is not an operating-system sandbox, and a resumed session can be missing, in which case the executor may rerun once without it.
Next lesson
Continue with Install a Codex worker.
Derivative map
- Weekly package: WEEK-17
- Long video: VIDEO-W17-LONG
- Shorts: SHORT-W17-PROBLEM, SHORT-W17-MECHANISM, SHORT-W17-WARNING
- Email: EMAIL-W17
- LinkedIn: LI-W17-A, LI-W17-B
- X: X-W17-A, X-W17-B
- Visual: VISUAL-W17
Review record
- CLI discovery, login boundary, permission mapping, output parsing, and resume behavior checked against current source.
- Supervisor environment, safe-mode, and missing-session limits reviewed.
- Installation proof avoids credential content and uses read-only work.
- Internal links and repository voice reviewed.
Review completed: 2026-09-03
Re-audited against the running product: 2026-09-13