User report: on a system with pre-existing legacy claude-code v2.1.112
(cli.js layout), running uclaude_install.sh announced
"SEA install complete: v2.1.120"
"Patch status: patched"
"Update complete."
yet `claude --version` still showed 2.1.112. Root cause:
1. ensure_claude_code() ran `npm install -g @anthropic-ai/claude-code@2.1.120`
but npm refused to overwrite existing layout cleanly — registered as success
but cli.js stayed in place.
2. SEA install in /usr/lib/.../@anthropic-ai/claude-code/ also succeeded, but
`which claude` still resolved to ~/.npm-global/bin/claude → legacy cli.js
because that prefix wins on PATH.
3. Updater's get_installed_version() found legacy cli.js first, reported 2.1.112.
Three fixes:
A. ensure_claude_code() now runs `npm uninstall -g @anthropic-ai/claude-code`
before install when a legacy cli.js is detected, then runs install with
--force. This guarantees clean SEA layout.
B. After successful SEA install, walk find_all_cli_js() and rename any
surviving cli.js → .legacy.bak. PATH resolution can no longer pick
stale cli.js over /usr/bin/claude.
C. Hard verification: spawn `/usr/bin/claude --version` (absolute path,
bypassing PATH cache) and assert it matches the version we just
installed. Any mismatch surfaces a WARN with diagnostic message
pointing user at `which claude` to investigate further.
After this fix the same install flow on the user's machine will report
v2.1.120 and `claude --version` will agree. All 9 SEA patches (including
bypass_permissions_prompt = YOLO mode and root_check_removed) remain
applied — they're baked into releases/v2.1.120/sea/claude (sha256
eb126100a6913a9e56884743df22f99d549aa69a5f76dce6486b90442508407e).
Root cause of "/model picker shows only 5 models": Anthropic removed
the CLAUDE_CUSTOM_MODELS env var sometime around v2.1.114. The picker
now reads exclusively from settings.json `availableModels` (a Zod-typed
allowlist field). We were:
- Writing CLAUDE_CUSTOM_MODELS into env.* (no longer read)
- Calling data.pop("availableModels", None) — actively REMOVING the
field that the picker now needs
So the picker fell back to built-in models + the two ANTHROPIC_DEFAULT_*
models, giving exactly 4 entries. Confirmed via strings on the v2.1.119
SEA binary: zero hits for "CLAUDE_CUSTOM_MODELS", but Zod schema
defines availableModels as the model allowlist.
Fix:
- patch_user() writes config['models'] into data['availableModels']
(still also sets the env var for backward-compat with side-by-side
older binaries)
- Verification block in install.sh + updater.py now reports both:
availableModels: N models (env.CLAUDE_CUSTOM_MODELS legacy: N)
Tested locally on v2.1.119 SEA install → settings.json now contains
availableModels with all 19 models. Restart claude → /model should show
the full list.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
After upstream switched to SEA (Single Executable Application) layout
in v2.1.114+, there is no cli.js anymore — only bin/claude.exe.
Before this fix:
- find_cli_js() searched only for cli.js → returned None on SEA installs
- get_installed_version() returned (None, None) → "Claude Code: not installed"
- is_patched() returned (False, [3 markers]) → false-negative even after
successful patch
- cmd_check showed "not installed" right after a successful update
- cmd_update would loop reinstalling because patch markers seemed missing
This contributed to a user-facing incident where /model picker showed
only built-in models even though CLAUDE_CUSTOM_MODELS was set in
settings.json: the binary update path was triggering uninstall+reinstall
cycles instead of being recognised as already-patched.
Changes:
- New find_claude_artifact() finds either cli.js or bin/claude.exe,
including the deeply-nested layout npm uses for SEA wrapper packages
- find_all_cli_js() returns both legacy and SEA artifacts
- is_patched() auto-detects layout: text scan for cli.js, bytes scan
for claude.exe (markers: /*ae1_models_filter_patched*/,
/*bypass_permissions_prompt*/)
- get_installed_version() reads package.json next to bin/ for SEA
- uclaude_install.sh adds binary marker verification at end of install
so users immediately see if the SEA payload was patched
Tests: new tests/test_sea_detect.py covers all 4 detector functions
against fake SEA install layouts (including nested form). All 20 tests
pass.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
User reported: after install, claude /model picker shows only 5 models
(built-ins) instead of 19 — config DID land somewhere but CLAUDE_CUSTOM_
MODELS env block in settings.json was empty/missing.
Hard to debug without seeing user's settings.json. Add verbose diagnostic:
uclaude_updater.py patch_all_users():
- Pre-check: warn if config has 0 models OR placeholder api_key
- Post-patch per user: read back the JUST-WRITTEN settings.json, count
CLAUDE_CUSTOM_MODELS entries, print:
"Patched root: /root/.claude/settings.json (env.CLAUDE_CUSTOM_MODELS=19 models)"
uclaude_install.sh — final verification block:
- Show ANTHROPIC_BASE_URL + AUTH_TOKEN prefix + custom_models count
- Loud warning if 0 models or auth_token missing
Now user can immediately see "0 models" or "19 models" without manually
inspecting settings.json. If 0 — knows config fetch failed silently.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
User hit two bugs in production:
1. uclaude_install.sh ERROR: Command failed at line 82 — gitea returned
transient HTTP 502 to `git fetch`, `2>/dev/null` masked stderr but
ERR trap fired with cryptic message.
2. After install, claude model picker showed only 5 models (built-in
defaults) instead of 19. Root cause: load_config() fell back to the
PUBLIC sanitized patcher.config.json (api_key='YOUR_API_KEY') after
remote fetch failed → claude API auth broken → custom models invisible.
Fixes:
claude/uclaude_install.sh:
- New retry_git() helper: 3 attempts, 5s backoff, loud diagnostic
- Existing-clone branch: retry_git wraps `git fetch` AND `git reset`
- Fallback: if fetch fails 3x on existing clone, nuke and re-clone fresh
(incremental fetch breaks more often than full clone on flaky gitea)
- Secondary fetch (before updater): tolerates failure with `|| true`
(we already have a working clone)
claude/uclaude_updater.py:
- _config_is_usable() guard: rejects {"api_key": "YOUR_API_KEY"} etc.
- load_config() retries remote 3x with backoff before falling back
- Removed local-file fallback (was loading public sanitized = bait)
- Cache-only fallback now (from previous successful fetch)
Public configs synced from canonical (api_key sanitized, models list
fully refreshed):
- claude/patcher.config.json: 17 → 19 models (+gpt-5.5, +gemini-3.1-pro etc)
- codex/codex_config.json: 4 → 5 models (+gpt-5.5)
- gemini/gemini_config.json: refreshed
- target_version: 2.1.112 → 2.1.119
Tests: tests/test_installer_robustness.py — 6 new GREEN guards.
Total: 196 → 207 GREEN.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Anthropic v2.1.71 blocks bypassPermissions for root (UID=0).
Added IS_SANDBOX=1 and CLAUDE_CODE_BUBBLEWRAP=1 to settings.json env.
Fixed effort_level: configurable from config instead of hardcoded "medium".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add NPM_REGISTRY constant and set_npm_registry() function
- Configure npm to use https://npm.sensey24.ru/ for @anthropic-ai scope
- Pass --registry flag to npm install commands
- Configure registry in uclaude_install.sh before running updater
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Add get_required_node_version() — fetches engines.node from npm registry
for @anthropic-ai/claude-code@latest and extracts required major version
- install_node() now installs setup_{major}.x matching Claude Code requirement
- ensure_node() uses dynamic version for checks and error messages
- Windows: Get-RequiredNodeMajor fetches version from npm registry
- Windows: MSI download uses required major version, not hardcoded v22
- Fallback to MIN_NODE_VERSION (18) if npm registry is unreachable
- Future-proof: when Claude Code raises requirement to 26+, scripts auto-adapt
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Replace hardcoded setup_24.x with setup_lts.x for Linux apt/dnf/yum
- Update Windows installer to use Node.js 22 LTS with dynamic version fetch
- Update install messages to reflect LTS instead of specific version
- Fixes: Node.js 24+ requirement causing installation failures on some systems
- Ensures latest LTS version (20.x, 22.x) is used instead of bleeding edge
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Handle case where which claude resolves directly to cli.js (not to .bin/claude)
- When claude binary basename is cli.js, add it directly to candidates
- When claude binary is in .bin/, resolve to parent node_modules/@anthropic-ai/claude-code/cli.js
- Fixes: which claude path not being properly included in multi-install patching
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Add find_all_cli_js() — discovers all cli.js paths across npm global dirs,
which claude symlink resolution, and NVM per-user installs
- Update cmd_update() to iterate all found paths and patch each one
- Update ensure_claude_code() to use find_all_cli_js() for install detection
- Fixes: `claude --version` showing old version when multiple Claude Code
installs exist (e.g. /usr/lib vs /usr/local/lib vs NVM)
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Changed MIN_NODE_VERSION from (24, 13, 0) to (18, 0, 0) to match Claude Code requirements
- Updated uclaude_install.sh to fetch latest repo before running updater
- Rewrote uclaude_update.ps1 to require v18+ and update repo first
- Added multiple fallback methods for Node.js installation on Windows
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without shell=True, subprocess.run(["npm", ...]) fails on Windows because
npm and claude are .cmd batch files, not .exe. Added run_cmd() wrapper that
sets shell=True only on Windows, keeping Linux/macOS behavior unchanged.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Primary: download from unlimitedcoding-config private repo via API token
- Cache: saves .patcher.config.cache.json for offline fallback
- Legacy fallback: still reads local patcher.config.json if present
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
package.json shows npm-installed version (e.g. 2.1.47) while the actual
patched cli.js contains 2.1.50. Now reads "// Version: x.y.z" from the
bundle first, falls back to claude --version, then package.json.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- install_node() now checks ver >= MIN_NODE_VERSION after install (was missing)
- ensure_claude_code() accepts target_version, upgrades npm package if mismatched
- cmd_update() hard-stops with clear message if Node.js can't be upgraded
- Removes stale nodesource apt list before install to prevent version conflicts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Wire ensure_claude_code() into cmd_update() — auto npm install if missing
- uclaude_install.sh: auto-install git, python3, curl via apt/dnf/yum/brew
- uclaude_update.bat: prereq checks with winget install suggestions
- uclaude_update.ps1: auto-install via winget (git, python, node)
- install_node(): macOS support via brew, RHEL/Fedora via rpm.nodesource
- Increased npm install timeout to 300s for slow connections
- Все claude-файлы перенесены в claude/ (uclaude_updater.py, скрипты, config)
- claude/README.md с инструкцией для Claude Code
- Корневой README — общий для всех продуктов (claude, codex, gemini, qwen, antigravity)
- Node.js v24.13+ автоустановка через nodesource
- Sparse checkout: клиент скачивает только latest версию cli.js
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>