claude-code: claude in the operator's zsh starts the agent's session where the machine names an agent account (hq ADR 0266) #168

Merged
mesh-admin merged 1 commits from feat/claude-is-the-agents-session into main 2026-10-09 22:20:52 +00:00
Contributor

Implements the operator's request of 2026-10-10 under hq ADR 0266 (on the control node, agents run under an account of their own) and to-be 36 §9 (the account the agent runs as). No hq issue: this is a feature of that decision.

What changes

  • New file resource agent-account-name: /etc/claude-code/agent-account, root's, 0644, holding ${machine:agent-account}.
  • New zsh code in the login shell's normal slot (ADR 0204, as mesh-cli places alias nox): it reads that file and adds alias claude=claude-agent only when the file names an account other than the shell's own ($USERNAME).
  • README: both described under the ADR 0266 section.

Why a file and not a guard on the fact in the code

  • The controller never fills ${machine:…} into shell code (environment_into.go, contributionsInto): contributed code is pasted unread.
  • ${machine:agent-account} is never empty where an operator account is known: where the node names no agent account it renders as the operator's account (machineFacts / agentAccount in machine_into_files.go). So the guard compares with the shell's own account, not with empty.
  • An environment variable would make the module depend on node-environment, which the control node does not run.

Where nothing changes: on g14, shanks and ace the file names the operator's account, so no alias is added. An empty or missing file also adds none.

No loop: claude-agent is an sh script ending exec claude / exec sudo -iu "$agent" claude; an alias belongs to an interactive zsh, and none of exec, sudo or sh expands it.

Tests (cmd/claude-code/shell_test.go): the file's resource; the alias stands once and only inside the guard; the code run in zsh adds the alias for another account and not for the shell's own account, an empty file or no file; and claude under the alias goes through claude-agent to the real claude (checked to fail without the alias). Module tests, words, agent-home and paths checks pass locally; mesh-controller module check (main) says claude-code ok, count of resources without health unchanged at 70.

Implements the operator's request of 2026-10-10 under hq ADR 0266 (on the control node, agents run under an account of their own) and to-be 36 §9 (the account the agent runs as). No hq issue: this is a feature of that decision. **What changes** - New file resource `agent-account-name`: `/etc/claude-code/agent-account`, root's, 0644, holding `${machine:agent-account}`. - New zsh code in the login shell's `normal` slot (ADR 0204, as mesh-cli places `alias nox`): it reads that file and adds `alias claude=claude-agent` only when the file names an account other than the shell's own (`$USERNAME`). - README: both described under the ADR 0266 section. **Why a file and not a guard on the fact in the code** - The controller never fills `${machine:…}` into shell code (environment_into.go, `contributionsInto`): contributed code is pasted unread. - `${machine:agent-account}` is never empty where an operator account is known: where the node names no agent account it renders as the operator's account (`machineFacts` / `agentAccount` in machine_into_files.go). So the guard compares with the shell's own account, not with empty. - An `environment` variable would make the module depend on node-environment, which the control node does not run. **Where nothing changes**: on g14, shanks and ace the file names the operator's account, so no alias is added. An empty or missing file also adds none. **No loop**: `claude-agent` is an `sh` script ending `exec claude` / `exec sudo -iu "$agent" claude`; an alias belongs to an interactive zsh, and none of `exec`, `sudo` or `sh` expands it. **Tests** (`cmd/claude-code/shell_test.go`): the file's resource; the alias stands once and only inside the guard; the code run in zsh adds the alias for another account and not for the shell's own account, an empty file or no file; and `claude` under the alias goes through `claude-agent` to the real `claude` (checked to fail without the alias). Module tests, words, agent-home and paths checks pass locally; `mesh-controller module check` (main) says claude-code ok, count of resources without health unchanged at 70.
mesh-admin added 1 commit 2026-10-09 22:17:09 +00:00
claude-code: claude in the operator's zsh starts the agent's session where the machine names an agent account (hq ADR 0266)
mesh/delivery covered: a later merge that contains it was delivered: novox/mesh-catalog@e4edab3fd0eb (merged as c41c32cb into main, walk plan-17916298010…
mesh/merge-gate pass: builds claude-code → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)
378c2b2ce8
Typing claude on the control node should start the session as the agent's own account, not as the
operator. The controller fills no machine fact into shell code, so the account agents run as is
written to /etc/claude-code/agent-account and the zsh code adds alias claude=claude-agent only when
that file names an account other than the shell's own. Where agents run as the operator's account,
nothing is added. claude-agent keeps running the real claude: exec sees no alias.
Author
Contributor

Delivery novox/mesh-catalog@378c2b2ce898 — covered since 2026-10-10T11:00:39Z

Delivery plan — builds claude-code → ace, g14, novox, shanks; no bus step

  • tier 0: claude-code
  • ace: receives claude-code
  • g14: receives claude-code
  • novox: receives claude-code
  • shanks: receives claude-code
  • claude-code keeps data (ADR 0233): what it holds is backed up before it moves

Transitions

  • 2026-10-09 22:17 (new) → proposed (announced): novox/mesh-catalog#168's head announced
  • 2026-10-09 22:19 proposed → checked (checked): the verdict names this commit
  • 2026-10-09 22:19 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
  • 2026-10-09 22:30 ready → held (hold): something holds it for a person: its group's composed check did not pass for the heads that merged, or it merged and no walk was opened for it
  • 2026-10-10 11:00 held → covered (covered): covered: a later merge that contains it was delivered: novox/mesh-catalog@e4edab3fd0 (merged as c41c32cb into main, walk plan-1791629801015330338): claude-code

The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-catalog@378c2b2ce898` — **covered** since 2026-10-10T11:00:39Z **Delivery plan** — builds claude-code → ace, g14, novox, shanks; no bus step - tier 0: claude-code - ace: receives claude-code - g14: receives claude-code - novox: receives claude-code - shanks: receives claude-code - claude-code keeps data (ADR 0233): what it holds is backed up before it moves **Transitions** - 2026-10-09 22:17 (new) → proposed (announced): novox/mesh-catalog#168's head announced - 2026-10-09 22:19 proposed → checked (checked): the verdict names this commit - 2026-10-09 22:19 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail - 2026-10-09 22:30 ready → held (hold): something holds it for a person: its group's composed check did not pass for the heads that merged, or it merged and no walk was opened for it - 2026-10-10 11:00 held → covered (covered): covered: a later merge that contains it was delivered: novox/mesh-catalog@e4edab3fd0eb (merged as c41c32cb into main, walk plan-1791629801015330338): claude-code The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
Author
Contributor

Merge check at 378c2b2c

  • mesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: claude-code)
  • mesh/repo-check: PASS — its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)

Delivery plan — builds claude-code → ace, g14, novox, shanks; no bus step

  • tier 0: claude-code
  • ace: receives claude-code
  • g14: receives claude-code
  • novox: receives claude-code
  • shanks: receives claude-code
  • claude-code keeps data (ADR 0233): what it holds is backed up before it moves

Run by the build seat on g14 as build-1791584235879962728 (builds --log build-1791584235879962728).

--- the gate: claude-code
claude-code: ok, 41 tool(s), keeps state servers, holdings, config, reads claude-licence-manager.bindings, keeps agent-home (valuable); WARNING: settings ask(s) for a setting and do(es) not say whether it is trusted, so it counts as trusted: set at the terminal alone; say "trusted" false where nothing trusts it (novox/hq issue 339)
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 1
1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 1 module(s) changed against 4 machine(s), as the snapshot of 2026-10-09T22:14:01Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-09T22:14:01Z

modules the change moves:
  - claude-code (changed)

machines:
  - a machine (f35): composes; the change adds 1 resource(s) and removes 0 (+file:claude-code.agent-account-name)
  - holds mesh-dns-resolver (idt): composes; the change adds 1 resource(s) and removes 0 (+file:claude-code.agent-account-name)
  - holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes; the change adds 1 resource(s) and removes 0 (+file:claude-code.agent-account-name)
  - a machine (yvbpsm): composes; the change adds 1 resource(s) and removes 0 (+file:claude-code.agent-account-name)

a merge would rebuild 1 module(s) in 1 tier(s): claude-code
--- its merge-check.sh (go toolchain)
ok  	git.novox.be/novox/mesh-catalog/checks/words	0.003s
words: 12 retired words and 70 daemons' lines, none in the 36404 strings of 629 files
ok  	git.novox.be/novox/mesh-catalog/checks/agenthome	0.009s
agent-home: no archive and no file written into under the agent's home
ok  	git.novox.be/novox/mesh-catalog/checks/paths	0.007s
paths: no module names another's state on its machine (3 known, listed to go)
long-running resources without health: 70, as kept
testing modules/claude-code
ok  	claude-code/cmd/claude-code	1.704s
--- its merge-check-typescript.sh (typescript toolchain)
**Merge check** at `378c2b2c` - `mesh/merge-gate`: **PASS** — every machine composes with the change as it did without (4 of 4 compose) (modules: claude-code) - `mesh/repo-check`: **PASS** — its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript) **Delivery plan** — builds claude-code → ace, g14, novox, shanks; no bus step - tier 0: claude-code - ace: receives claude-code - g14: receives claude-code - novox: receives claude-code - shanks: receives claude-code - claude-code keeps data (ADR 0233): what it holds is backed up before it moves Run by the build seat on g14 as `build-1791584235879962728` (`builds --log build-1791584235879962728`). ``` --- the gate: claude-code claude-code: ok, 41 tool(s), keeps state servers, holdings, config, reads claude-licence-manager.bindings, keeps agent-home (valuable); WARNING: settings ask(s) for a setting and do(es) not say whether it is trusted, so it counts as trusted: set at the terminal alone; say "trusted" false where nothing trusts it (novox/hq issue 339) long-running resources without health: 0 files asking for a setting without saying whether it is trusted: 1 1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here judging 1 module(s) changed against 4 machine(s), as the snapshot of 2026-10-09T22:14:01Z says they run composing every machine as the mesh is the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued composing every machine with the change the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose) judged by controller development build against the facts of 2026-10-09T22:14:01Z modules the change moves: - claude-code (changed) machines: - a machine (f35): composes; the change adds 1 resource(s) and removes 0 (+file:claude-code.agent-account-name) - holds mesh-dns-resolver (idt): composes; the change adds 1 resource(s) and removes 0 (+file:claude-code.agent-account-name) - holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes; the change adds 1 resource(s) and removes 0 (+file:claude-code.agent-account-name) - a machine (yvbpsm): composes; the change adds 1 resource(s) and removes 0 (+file:claude-code.agent-account-name) a merge would rebuild 1 module(s) in 1 tier(s): claude-code --- its merge-check.sh (go toolchain) ok git.novox.be/novox/mesh-catalog/checks/words 0.003s words: 12 retired words and 70 daemons' lines, none in the 36404 strings of 629 files ok git.novox.be/novox/mesh-catalog/checks/agenthome 0.009s agent-home: no archive and no file written into under the agent's home ok git.novox.be/novox/mesh-catalog/checks/paths 0.007s paths: no module names another's state on its machine (3 known, listed to go) long-running resources without health: 70, as kept testing modules/claude-code ok claude-code/cmd/claude-code 1.704s --- its merge-check-typescript.sh (typescript toolchain) ```
mesh-admin merged commit 553b71916e into main 2026-10-09 22:20:52 +00:00
mesh-admin deleted branch feat/claude-is-the-agents-session 2026-10-09 22:20:52 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#168