Skip to content

feat: make Claude Code auto-updater configurable - #63

Merged
alanbem merged 2 commits into
mainfrom
feat/configurable-claude-autoupdater
May 30, 2026
Merged

feat: make Claude Code auto-updater configurable#63
alanbem merged 2 commits into
mainfrom
feat/configurable-claude-autoupdater

Conversation

@alanbem

@alanbem alanbem commented May 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Configurable auto-updater: The image hardcoded DISABLE_AUTOUPDATER=1, so Claude Code never updated at runtime. This removes that and defers to Claude Code's own default (auto-update enabled), exposing a knob to opt back into disabling it:
    • Env var: DCLAUDE_DISABLE_AUTOUPDATER=1
    • .dclaude key: DISABLE_AUTOUPDATER=1
    • Precedence: env > .dclaude > unset. Passed into the container only when set (mirrors the CLAUDE_MODEL passthrough).
  • Bug fix (pre-existing): load_config_file leaked the exit status of its last &&-style case branch. Under set -euo pipefail, a .dclaude whose last line was already overridden by an env var made the function return non-zero and silently abort dclaude (reproduced with the existing AWS_CLI var). Added return 0.
  • Untrack .mcp.json: generated per-project by dclaude chrome, so it's removed from the index (kept on disk) and gitignored.
  • Docs: README env/.dclaude tables + CLAUDE.md install notes (incl. the ~/.local-not-a-volume persistence caveat).

Notes / behavior change

  • New containers from the post-merge image will self-update Claude Code at runtime. Persistent containers (the default) update once and keep it until dclaude rm; ephemeral ones (DCLAUDE_RM=true) re-download per run.

Test plan

Verified against a local build (alanbem/dclaude:local):

  • DCLAUDE_DISABLE_AUTOUPDATER=1-e DISABLE_AUTOUPDATER=1 in the docker args, and confirmed DISABLE_AUTOUPDATER=1 on the running container
  • unset (no env, no config) → no DISABLE_AUTOUPDATER passed (defers to Claude default)
  • .dclaude with DISABLE_AUTOUPDATER=1 → flag set to 1
  • env =0 overrides .dclaude=1 → flag set to 0 (env precedence)
  • image ENV no longer carries DISABLE_AUTOUPDATER
  • regression: AWS_CLI last-line + env override now exits cleanly (was silent exit 1)
  • bash -n dclaude clean

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added DISABLE_AUTOUPDATER configuration option to control Claude Code's runtime auto-updater behavior
  • Configuration Changes

    • Docker containers now enable runtime auto-updates by default
    • Auto-update settings available via environment variable or configuration file
  • Documentation

    • Updated documentation with auto-updater configuration options and defaults

Review Change Stack

alanbem and others added 2 commits May 31, 2026 01:06
.mcp.json is generated per-project by `dclaude chrome`, so it should not
be version-controlled. Remove it from the index (kept on disk) and ignore it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The image hardcoded DISABLE_AUTOUPDATER=1, so Claude Code never updated at
runtime. Defer to Claude Code's own default (auto-update enabled) and expose
a DCLAUDE_DISABLE_AUTOUPDATER env var / DISABLE_AUTOUPDATER .dclaude key
(precedence: env > .dclaude > unset) to opt back into disabling it. The flag
is passed into the container only when set.

Also fix a pre-existing bug in load_config_file: under `set -euo pipefail`,
the function leaked the exit status of the last `&&`-style case branch, so a
.dclaude file whose last line was already overridden by an env var would make
the function return non-zero and silently abort dclaude. Force `return 0`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 699800ab-f8b9-4359-92ed-79049a115bcb

📥 Commits

Reviewing files that changed from the base of the PR and between a5e8f8d and f9610b9.

📒 Files selected for processing (6)
  • .gitignore
  • .mcp.json
  • CLAUDE.md
  • README.md
  • dclaude
  • docker/Dockerfile
💤 Files with no reviewable changes (1)
  • .mcp.json

📝 Walkthrough

Walkthrough

This PR adds configuration support for disabling Claude Code's runtime auto-updater via a new DISABLE_AUTOUPDATER setting. The dclaude script now parses this key from .dclaude config files and forwards it to the container as an environment variable, while the Dockerfile removes the hardcoded disabling flag to allow runtime control. Documentation and .mcp.json gitignore rules are also updated.

Changes

Auto-updater Configuration Support

Layer / File(s) Summary
dclaude script configuration and container forwarding
dclaude
dclaude script parses DISABLE_AUTOUPDATER from .dclaude config files (respecting existing env var precedence), resolves it as a readonly variable, logs it in debug output, and conditionally injects it into the Docker container environment via -e DISABLE_AUTOUPDATER=....
Dockerfile runtime auto-updater enablement
docker/Dockerfile
Dockerfile removes the hardcoded DISABLE_AUTOUPDATER=1 from the ENV block and updates the build-time comment to reflect that runtime auto-updates are now permitted, shifting updater control from build-time to runtime.
Configuration reference documentation
README.md, CLAUDE.md
README.md adds DCLAUDE_DISABLE_AUTOUPDATER environment variable and DISABLE_AUTOUPDATER config file entries to configuration tables; CLAUDE.md documents the config option and clarifies that auto-updates follow Claude Code's default behavior when the setting is unset, including a note about update persistence tied to container lifetime.
MCP configuration cleanup
.gitignore
.gitignore is updated to exclude .mcp.json files from version control under the "Claude local data" section.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • alanbem/dclaude#30: #30 hard-codes DISABLE_AUTOUPDATER=1 in the Docker image, while this PR adds runtime configurability by removing that setting and threading it through dclaude and .dclaude.
  • alanbem/dclaude#32: Both PRs extend dclaude's .dclaude config-loading flow to thread new keys (this PR adds DISABLE_AUTOUPDATER, #32 adds namespace configuration) into the resolved environment and container launch.
  • alanbem/dclaude#60: This PR removes .mcp.json from tracking (adding to .gitignore), while #60 adds/documents a .mcp.json Chrome DevTools MCP setup, affecting the same configuration file.

Poem

🐰 The auto-updater's reins are now in hand,
No more fixed in Docker's unchanging sand,
Config flows through dclaude's gentle parse,
Keeping Claude fresh—or frozen, at last,
A simple toggle to control the race! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: making Claude Code's auto-updater configurable. It directly corresponds to the primary objective of introducing user-configurable knobs for controlling auto-update behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/configurable-claude-autoupdater

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alanbem
alanbem merged commit 40e89e1 into main May 30, 2026
10 checks passed
@alanbem
alanbem deleted the feat/configurable-claude-autoupdater branch May 30, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant