Skip to content

Conversation

@DevelopmentCats
Copy link
Contributor

@DevelopmentCats DevelopmentCats commented Nov 17, 2025

Description

Claude-Code auto-updates itself unless the DISABLE_AUTOUPDATER env is set. This PR adds a disable_autoupdater variable which allows the user to disable claude-code's auto updating feature. This should resolve the issue where claude-code updates itself when a user defines a specific claude-code version to be installed which was confusing for the end user.

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/claude-code
New version: v4.2.0
Breaking change: [ ] Yes [X] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

Related Issues

@DevelopmentCats DevelopmentCats requested review from Copilot and matifali and removed request for matifali November 17, 2025 21:02
Copilot finished reviewing on behalf of DevelopmentCats November 17, 2025 21:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new enable_auto_update variable to control whether Claude Code automatically updates itself. By default, auto-updates are now disabled, addressing the confusing behavior where Claude Code would update itself even when users specified a specific version to install.

  • Added enable_auto_update boolean variable (default: false) to control auto-update behavior
  • Implemented conditional DISABLE_AUTOUPDATER environment variable based on the new setting
  • Updated all README examples to reference version 4.2.0

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
registry/coder/modules/claude-code/main.tf Added enable_auto_update variable and conditional coder_env resource to set DISABLE_AUTOUPDATER when auto-updates are disabled
registry/coder/modules/claude-code/README.md Updated version references from 4.1.0 to 4.2.0 across all usage examples
Comments suppressed due to low confidence (1)

registry/coder/modules/claude-code/README.md:99

  • The new enable_auto_update variable is not documented in the README. Consider adding an example that demonstrates how to use this variable, especially since the PR description mentions that this resolves a confusing issue where claude-code updates itself even when a specific version is pinned. An example showing how to pin a version and disable auto-updates would be helpful:
module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" version = "4.2.0" agent_id = coder_agent.example.id workdir = "/home/coder/project" claude_code_version = "1.0.82" enable_auto_update = false # Ensures Claude Code stays on version 1.0.82 }
 version = "4.2.0" agent_id = coder_agent.example.id workdir = "/home/coder/project" claude_api_key = "xxxx-xxxxx-xxxx" # OR claude_code_oauth_token = "xxxxx-xxxx-xxxx" claude_code_version = "1.0.82" # Pin to a specific version agentapi_version = "v0.10.0" ai_prompt = data.coder_parameter.ai_prompt.value model = "sonnet" permission_mode = "plan" mcp = <<-EOF { "mcpServers": { "my-custom-tool": { "command": "my-tool-server" "args": ["--port", "8080"] } } } EOF } 
@matifali
Copy link
Member

I think we should keep the default behavior and allow disabling as opt in for the ones who need it.

…se which mimics the native behaviour of claude-code
@DevelopmentCats DevelopmentCats changed the title feat: add auto-update variable to control auto-updates feat: add disable_autoupdater variable to control auto-updates Nov 18, 2025
@DevelopmentCats
Copy link
Contributor Author

@matifali

I have updated this and you are right it feels much better this way

@DevelopmentCats DevelopmentCats merged commit 73a92be into main Nov 18, 2025
4 checks passed
@DevelopmentCats DevelopmentCats deleted the cat/claude-dupe-fix branch November 18, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants