Skip to content

Decide Whether a claude or codex With No Native Copy Is a Stray Once install-agents Records the Native Copy #4402

Done

Description

@ptr727

Question

When install-agents records the native installer's copy as the managed copy of claude and codex, is a claude or codex from npm, bun, Homebrew, or mise a stray even where no native copy exists at all? Or is it a stray only where the native copy also exists, the duplicate the 2026-11-15 answer on #4158 names?

This blocks #4158, and #4210, whose one remaining item is #4158 implemented as detect-and-report. No pull request is open for it yet. Its branch burndown/claude-codex-managed-copy holds no commits.

Why it needs the maintainer

The answer on #4158 settled report-only for "an npm or Homebrew copy of claude or codex ahead of the managed native copy". It did not settle the host whose only claude or codex is an npm one. opencode's existing mechanism, which the change mirrors, reads that host's copy as a stray too. For claude and codex that is a much larger change than for opencode, and it ends a behavior the fleet relies on today.

What was measured

  • Each native installer runs on both platforms, so no npm fallback is needed on Windows as it is for opencode.
    • Linux claude: https://claude.ai/install.sh downloads the binary and runs its own claude install, which lands it in ~/.local/bin, per the script's own sudo comment.
    • Linux codex: https://chatgpt.com/codex/install.sh writes ${CODEX_INSTALL_DIR:-$HOME/.local/bin}/codex.
    • Windows codex: https://chatgpt.com/codex/install.ps1 writes %LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe, or under CODEX_INSTALL_DIR. That bin is a junction to the current release.
    • Windows claude: https://claude.ai/install.ps1 runs claude.exe install and does not name the location in the script. install-agents.ps1 already appends ~/.local/bin to the session PATH.
  • Adding only claude_managed and codex_managed records to install-agents.sh, with opencode's existing stray test unchanged, fails 30 of its 61 Linux tests.
    • Every claude or codex copy outside ~/.local/bin becomes a stray, so nothing upgrades it. That covers each npm, bun, mise, and Homebrew test that uses claude or codex to exercise a manager upgrade.
    • On Linux no tool other than claude, codex, and opencode has an npm package, and opencode is already installer-managed there. So the npm and bun upgrade paths would reach no tool. The same holds for bun on Windows, where only npm remains reached, through opencode's managed package.
    • An npm-only claude below the fleet floor is today lifted by the nightly npm upgrade. It would instead be reported each run with its hand fix and left below the floor.

Options, recommended first

  1. Full mirror of opencode, with the paths no tool reaches then removed in a follow-up pull request of their own. Recommended. A claude or codex from any source other than its native installer is a stray, reported with the command that removes it and then --install, and never upgraded or removed here. That treats an npm or Homebrew install as the wrong install method GOVERNANCE.md "Design Before Code" names as a one-off, and it gives the three tools one behavior, which is what Consolidate claude and codex Into One Managed Copy in install-agents #4158's title asks for. The removal goes in its own pull request so each diff is reviewed alone, the lesson of the withdrawn Offer the Next .NET Major Under the Windows Installer's -Optional Set #4186. Effect on the parked work: it resumes as this change, with the manager-upgrade tests that used claude or codex moved to herdr where a manager still reaches it, rewritten as stray tests otherwise, and the unreachable npm and bun upgrade code listed in the body as removal candidates.
  2. Full mirror, with the unreachable npm and bun upgrade paths removed in this same pull request. One change, and no code is left that nothing reaches. The cost is a much larger diff across both installers and their tests in one review. Effect on the parked work: it resumes as this change plus that removal.
  3. Report a non-native copy only where the native copy also exists. An npm, bun, Homebrew, or mise claude or codex with no native copy keeps today's upgrade through its manager, the floor check included. Only the duplicate is reported. This is the smallest diff and keeps every existing test. The cost is that claude and codex then differ from opencode, an npm-only install is never reported as the wrong method, and the fleet keeps hosts on more than one install method. Effect on the parked work: it resumes as a small change confined to the stray test, the two records, and new duplicate tests.

🤖 Generated with Claude Code

Activity

  1. added
    decision
    on Nov 24, 2026
  2. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Maintainer's answer, 2026-11-24 (recorded at the session handoff): option 1. Mirror opencode exactly: a claude or codex from any source other than its native installer is a stray, reported with the command that removes it and then --install, and is never upgraded or removed here. The npm and bun upgrade paths that then reach no tool are removed in a separate follow-up pull request, which the resuming worker lists in its PR body and files as its own issue. #4158 and #4210 resume on this.

  3. removed
    decision
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions