A user must install one exact Claude Code version to run Martha: Martha should install the recorded version itself #305

Closed
opened 2026-11-27 10:34:34 +00:00 by supervisor · 3 comments
Owner

Purpose (product): a person installs Martha with one line and runs Claude Code members without installing, pinning or downgrading Claude Code themselves; their own claude stays whatever version they use.

Raf, 2026-11-27: "that's not very user-friendly, isn't it?" (on the getting-started step "install Claude Code at the recorded version"), and on placement: "after the cooldown".

Today: the Claude Code adapter derives from facts read out of one binary (src/claude_code_host/recorded_claude_code_host.json, host_version 2.1.332). docs/getting-started.md asks the user to npm install -g @anthropic-ai/claude-code@<the recorded version>, which overwrites the version they use for their own work.

Proposed (as Martha already does for the mesh server and martha-engine): the installer or martha install puts the recorded Claude Code version into Martha's own release folder, from a pinned lock and integrity, and every Claude Code member launches that binary by path. The user signs in once with their own claude; the design step checks how the private copy finds that sign-in (sign_in_store_variable in the recording).

Done-when: a fresh Linux box with any (or no) global Claude Code runs martha init, martha approve, martha up with a Claude Code member, which runs the recorded version; the global claude --version is unchanged; getting-started no longer has the install step.

Placement: after the Claude cooldown (Raf). Design first.

Refs docs/getting-started.md, #303

Purpose (product): a person installs Martha with one line and runs Claude Code members without installing, pinning or downgrading Claude Code themselves; their own `claude` stays whatever version they use. Raf, 2026-11-27: "that's not very user-friendly, isn't it?" (on the getting-started step "install Claude Code at the recorded version"), and on placement: "after the cooldown". Today: the Claude Code adapter derives from facts read out of one binary (src/claude_code_host/recorded_claude_code_host.json, host_version 2.1.332). docs/getting-started.md asks the user to `npm install -g @anthropic-ai/claude-code@<the recorded version>`, which overwrites the version they use for their own work. Proposed (as Martha already does for the mesh server and martha-engine): the installer or `martha install` puts the recorded Claude Code version into Martha's own release folder, from a pinned lock and integrity, and every Claude Code member launches that binary by path. The user signs in once with their own `claude`; the design step checks how the private copy finds that sign-in (sign_in_store_variable in the recording). Done-when: a fresh Linux box with any (or no) global Claude Code runs `martha init`, `martha approve`, `martha up` with a Claude Code member, which runs the recorded version; the global `claude --version` is unchanged; getting-started no longer has the install step. Placement: after the Claude cooldown (Raf). Design first. Refs docs/getting-started.md, #303
Member

Design r1: Martha carries its own Claude Code (no code yet)

Based on forge main ee374a16 (includes #303). Raf's ruling for this package: DECIDED 2026-11-27 "after the cooldown". Everything else below is IDEA until Raf rules on it.

Raf's two questions, answered plainly

"why does martha need such a specific claude version?"
Martha's safety gate for a Claude Code member is built from facts read out of one Claude Code build, the recording (src/claude_code_host/recorded_claude_code_host.json, 2.1.332). The facts include:

  • every tool the build registers, each of which the gate must allow or refuse;
  • the hook events it fires;
  • the switch that turns memory off;
  • where managed settings and the sign-in live.

Claude Code ships new releases almost daily, and they do change these facts: in #811, one release (2.1.327 → 2.1.328) changed 5 of the 26 recorded facts.

On a version Martha has never read, two things can go wrong without anyone noticing:

  • a new tool can run that the gate never judged;
  • a moved switch can stop working, for example memory writing into the user's own ~/.claude.

Today Martha only prints a notice (hostVersionLine, what_the_host_loads.ts:100) and starts the member anyway. Within days of a release, nearly every user runs a newer claude than the recording, so most users' members run on a gate nobody has checked against their version.

"that's not very user-friendly, isn't it?"
No, it isn't. But the unfriendly part is asking people to pin their own claude, not the pin. A notice alone stays friendly but leaves the gate unproved, so it doesn't do the job. The fix is the one Raf ruled: Martha keeps its own copy of the recorded version, and the user's claude stays whatever they run. The user never sees a version number.

Design (simplest thing that works)

  1. Where it lives. Inside the Martha release folder, at ~/.local/share/martha/<version>/claude-code/. This follows the pattern Martha already uses to install the recorded mesh server and engine. Each release carries the Claude Code version its recording is of, so the two can never drift apart.
  2. How it is fetched.
    • The tree commits a two-file lock, claude_code_lock/package.json + package-lock.json, naming @anthropic-ai/claude-code@<host_version> and its linux-x64 package with npm's sha512 integrity.
    • The recorder writes the lock from the recording, never by hand, and the drift check holds the lock to host_version.
    • Install runs Martha's own npm: npm ci --prefix <release>/claude-code. npm refuses any byte that doesn't match the integrity.
    • It then checks that claude --version prints host_version, the same check as the_recorded_host_installed.sh.
  3. When it is fetched. The installer runs it right after it lays out a release (install and upgrade). martha up refuses a missing or wrong copy by name and names the one line that installs it, like the engine does (martha engine install).
  4. How members use it. The Claude Code row of a launch resolves its binary by absolute path to the release's copy, never through PATH. The version notice goes away because a mismatch can no longer happen. DISABLE_AUTOUPDATER=1 is already in the row's env_last (#460), so the copy never updates itself or the user's global install.
  5. Sign-in. Nothing changes in how a member is signed in. Each member already runs with a config folder of its own, and a member billed by the subscription is pointed at the owner's default sign-in store (theMembersConfigEnvironment, give_a_member_its_own_config.ts:118). Only the binary changes. With no global claude at all, the user runs a new martha sign-in, which starts Martha's copy interactively once to fill that default store. The proof must show that a sign-in written by a newer global claude is read by the older copy (open risk R2).
  6. Update path. A Martha release that re-records the host carries the new lock, and installing that release installs its copy. Nothing else changes.
  7. Way back. Rolling Martha back to an older release folder brings back that release's own copy. Nothing extra to do.
  8. Tests. No outside call. The tests use a stand-in npm and a local tarball whose fake claude prints a DUMMY version, so they cover install, refusal of a wrong integrity, refusal of a wrong version, and the launch by path. The one real fetch runs in the existing clean-install container proof, which already installs Claude Code today.
  9. Docs. getting-started.md loses the "install Claude Code at the recorded version" step and its asdf caveat. It gains one line: sign in once with claude, or martha sign-in without one.

Needs Raf's ruling before code

  • R1, where the bytes come from. The brief says forge only. But Claude Code is proprietary ("© Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements", its LICENSE.md). Putting a copy on our public forge registry would be redistribution, and I cannot confirm Anthropic's terms allow it.
    • Recommended: fetch from Anthropic's own npm registry (registry.npmjs.org, not GitHub), pinned by sha512 in the lock. That is one fetch at install, triggered by the user, and never from a test.
    • Alternative: a forge mirror, only after someone confirms the licence allows it.
  • R2, sign-in shared across versions. If an older copy can't read a sign-in written by a newer global claude, the copy needs a store of its own, and the user signs in once more through martha sign-in. The proof settles this. No code goes in for it unless the proof fails.
  • Disk. The native binary is about 300 MB per release folder (2.1.316 measured on host00). Old release folders are pruned the way they are today, so this adds no new rule.

Done-when (from the issue, unchanged)

A fresh Linux box with any Claude Code installed globally, or none, runs martha init, martha approve and martha up with a Claude Code member. That member runs the recorded version, the global claude --version is unchanged, and getting-started no longer has the install step.

## Design r1: Martha carries its own Claude Code (no code yet) Based on forge main ee374a16 (includes #303). Raf's ruling for this package: DECIDED 2026-11-27 "after the cooldown". Everything else below is IDEA until Raf rules on it. ### Raf's two questions, answered plainly **"why does martha need such a specific claude version?"** Martha's safety gate for a Claude Code member is built from facts read out of one Claude Code build, the recording (`src/claude_code_host/recorded_claude_code_host.json`, 2.1.332). The facts include: - every tool the build registers, each of which the gate must allow or refuse; - the hook events it fires; - the switch that turns memory off; - where managed settings and the sign-in live. Claude Code ships new releases almost daily, and they do change these facts: in #811, one release (2.1.327 → 2.1.328) changed 5 of the 26 recorded facts. On a version Martha has never read, two things can go wrong without anyone noticing: - a new tool can run that the gate never judged; - a moved switch can stop working, for example memory writing into the user's own `~/.claude`. Today Martha only prints a notice (`hostVersionLine`, `what_the_host_loads.ts:100`) and starts the member anyway. Within days of a release, nearly every user runs a newer `claude` than the recording, so most users' members run on a gate nobody has checked against their version. **"that's not very user-friendly, isn't it?"** No, it isn't. But the unfriendly part is asking people to pin their own `claude`, not the pin. A notice alone stays friendly but leaves the gate unproved, so it doesn't do the job. The fix is the one Raf ruled: Martha keeps its own copy of the recorded version, and the user's `claude` stays whatever they run. The user never sees a version number. ### Design (simplest thing that works) 1. **Where it lives.** Inside the Martha release folder, at `~/.local/share/martha/<version>/claude-code/`. This follows the pattern Martha already uses to install the recorded mesh server and engine. Each release carries the Claude Code version its recording is of, so the two can never drift apart. 2. **How it is fetched.** - The tree commits a two-file lock, `claude_code_lock/package.json` + `package-lock.json`, naming `@anthropic-ai/claude-code@<host_version>` and its linux-x64 package with npm's sha512 integrity. - The recorder writes the lock from the recording, never by hand, and the drift check holds the lock to `host_version`. - Install runs Martha's own npm: `npm ci --prefix <release>/claude-code`. npm refuses any byte that doesn't match the integrity. - It then checks that `claude --version` prints `host_version`, the same check as `the_recorded_host_installed.sh`. 3. **When it is fetched.** The installer runs it right after it lays out a release (install and upgrade). `martha up` refuses a missing or wrong copy by name and names the one line that installs it, like the engine does (`martha engine install`). 4. **How members use it.** The Claude Code row of a launch resolves its binary by absolute path to the release's copy, never through `PATH`. The version notice goes away because a mismatch can no longer happen. `DISABLE_AUTOUPDATER=1` is already in the row's `env_last` (#460), so the copy never updates itself or the user's global install. 5. **Sign-in.** Nothing changes in how a member is signed in. Each member already runs with a config folder of its own, and a member billed by the subscription is pointed at the owner's default sign-in store (`theMembersConfigEnvironment`, `give_a_member_its_own_config.ts:118`). Only the binary changes. With no global `claude` at all, the user runs a new `martha sign-in`, which starts Martha's copy interactively once to fill that default store. The proof must show that a sign-in written by a newer global `claude` is read by the older copy (open risk R2). 6. **Update path.** A Martha release that re-records the host carries the new lock, and installing that release installs its copy. Nothing else changes. 7. **Way back.** Rolling Martha back to an older release folder brings back that release's own copy. Nothing extra to do. 8. **Tests.** No outside call. The tests use a stand-in npm and a local tarball whose fake `claude` prints a DUMMY version, so they cover install, refusal of a wrong integrity, refusal of a wrong version, and the launch by path. The one real fetch runs in the existing clean-install container proof, which already installs Claude Code today. 9. **Docs.** `getting-started.md` loses the "install Claude Code at the recorded version" step and its asdf caveat. It gains one line: sign in once with `claude`, or `martha sign-in` without one. ### Needs Raf's ruling before code - **R1, where the bytes come from.** The brief says forge only. But Claude Code is proprietary ("© Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements", its LICENSE.md). Putting a copy on our public forge registry would be redistribution, and I cannot confirm Anthropic's terms allow it. - **Recommended:** fetch from Anthropic's own npm registry (registry.npmjs.org, not GitHub), pinned by sha512 in the lock. That is one fetch at install, triggered by the user, and never from a test. - **Alternative:** a forge mirror, only after someone confirms the licence allows it. - **R2, sign-in shared across versions.** If an older copy can't read a sign-in written by a newer global `claude`, the copy needs a store of its own, and the user signs in once more through `martha sign-in`. The proof settles this. No code goes in for it unless the proof fails. - **Disk.** The native binary is about 300 MB per release folder (2.1.316 measured on host00). Old release folders are pruned the way they are today, so this adds no new rule. ### Done-when (from the issue, unchanged) A fresh Linux box with any Claude Code installed globally, or none, runs `martha init`, `martha approve` and `martha up` with a Claude Code member. That member runs the recorded version, the global `claude --version` is unchanged, and getting-started no longer has the install step.
Member

Design r1, appended note: R1 ruled

DECIDED 2026-11-30 "Anthropic's npm (Recommended)": Martha's Claude Code copy is fetched from Anthropic's npm registry (registry.npmjs.org), pinned by sha512 in the committed lock. There is no forge mirror. Point 2 of the design stands as written. The one real fetch happens when a user installs and in the clean-install container proof, never in a test.

Still open: R2 (whether a newer claude's sign-in is read by the older copy), settled by the proof.

## Design r1, appended note: R1 ruled DECIDED 2026-11-30 "Anthropic's npm (Recommended)": Martha's Claude Code copy is fetched from Anthropic's npm registry (registry.npmjs.org), pinned by sha512 in the committed lock. There is no forge mirror. Point 2 of the design stands as written. The one real fetch happens when a user installs and in the clean-install container proof, never in a test. Still open: R2 (whether a newer `claude`'s sign-in is read by the older copy), settled by the proof.
Member

Landed on main at dc79b38bec (batch #327; branch tip 34cdcf04 is an ancestor, checked with git merge-base --is-ancestor). Done-when against that tip:

  • martha up with a Claude Code member runs the recorded version: up installs the recorded Claude Code into ~/.local/share/martha/claude-code/ (npm ci on the committed lock from registry.npmjs.org, sha512 per tarball, scripts off), refuses a binary that reports another version, and launches members by that path, never claude from PATH. Tests: bring_up_the_declared_crew.node-test.ts "martha#305: up installs Martha's own Claude Code once…" and "…installs nothing for a crew whose Claude Code members are all parked…"; install_the_recorded_claude_code.node-test.ts (7 tests, including the version refusal and the lock check).
  • The global claude --version is unchanged: the install writes only into Martha's own folder; nothing runs npm install -g. Test: "a host without it is told the one command that installs it, and that its own claude stays".
  • getting-started no longer has the install step: docs/getting-started.md line 36: "Claude Code: nothing to install. Martha runs its own copy…", with martha sign-in for a box without its own claude.
  • A fresh Linux box, with any or no global Claude Code: the tests use a stand-in npm (no test calls an outside service). Nobody has yet run this live on a real fresh box: unverified.

Review: Jupiter PASS at r=2. CI r=2 runs 6029–6034 green; batch round 6035–6041 green.

Follow-up: two martha up runs installing at the same moment race (filed separately).

Landed on main at dc79b38bec04246d3fdec730f4f1732cbebd65ca (batch #327; branch tip 34cdcf04 is an ancestor, checked with `git merge-base --is-ancestor`). Done-when against that tip: - **`martha up` with a Claude Code member runs the recorded version:** `up` installs the recorded Claude Code into `~/.local/share/martha/claude-code/` (npm ci on the committed lock from registry.npmjs.org, sha512 per tarball, scripts off), refuses a binary that reports another version, and launches members by that path, never `claude` from PATH. Tests: `bring_up_the_declared_crew.node-test.ts` "martha#305: up installs Martha's own Claude Code once…" and "…installs nothing for a crew whose Claude Code members are all parked…"; `install_the_recorded_claude_code.node-test.ts` (7 tests, including the version refusal and the lock check). - **The global `claude --version` is unchanged:** the install writes only into Martha's own folder; nothing runs `npm install -g`. Test: "a host without it is told the one command that installs it, and that its own claude stays". - **getting-started no longer has the install step:** docs/getting-started.md line 36: "Claude Code: nothing to install. Martha runs its own copy…", with `martha sign-in` for a box without its own `claude`. - **A fresh Linux box, with any or no global Claude Code:** the tests use a stand-in npm (no test calls an outside service). Nobody has yet run this live on a real fresh box: **unverified**. Review: Jupiter PASS at r=2. CI r=2 runs 6029–6034 green; batch round 6035–6041 green. Follow-up: two `martha up` runs installing at the same moment race (filed separately).
venus closed this issue 2026-12-01 02:13:21 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha#305
No description provided.