fix: disable Claude auto-updater in all cac-managed environments#62
Merged
fix: disable Claude auto-updater in all cac-managed environments#62
Conversation
Claude's auto-updater runs mid-session and re-execs a new binary directly, bypassing the cac wrapper (no fingerprint hook, no timezone spoofing, no dns-guard). Claude Code migrated the disable mechanism from .claude.json to settings.json env.DISABLE_AUTOUPDATER=1. - _write_env_settings: add DISABLE_AUTOUPDATER=1 to new env settings.json - _ensure_initialized: patch all existing envs on every cac invocation (idempotent)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a new cac environment is created and Claude starts for the first time, it has no
settings.jsonentry to disable auto-updates. Claude triggers its auto-updater mid-session, re-execs a new binary directly (not through the cac wrapper), bypassing:The session UI still shows the old version number, but
/usagereveals the real timezone — the classic symptom.Root cause
Claude Code migrated the "disable auto-updates" mechanism from
autoUpdates: falsein.claude.jsontoDISABLE_AUTOUPDATER=1insettings.json. cac's_write_env_settingstemplate didn't include this field, so new envs were left unprotected.Fix
src/templates.sh— addenv.DISABLE_AUTOUPDATER: "1"to thesettings.jsontemplate written onenv createsrc/cmd_setup.sh— in_ensure_initialized, patch all existing envsettings.jsonfiles to add the field if missing (idempotent, runs on everycacinvocation)No
.claude.jsonis touched.