Skip to content

Commit 73a92be

Browse files
feat: add disable_autoupdater variable to control auto-updates (#545)
## 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. <!-- Briefly describe what this PR does and why --> ## Type of Change - [ ] New module - [ ] New template - [X] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information <!-- Delete this section if not applicable --> **Path:** `registry/coder/modules/claude-code` **New version:** `v4.2.0` **Breaking change:** [ ] Yes [X] No ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun fmt`) - [X] Changes tested locally ## Related Issues <!-- Link related issues or write "None" if not applicable -->
1 parent 71c84a8 commit 73a92be

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude
1313
```tf
1414
module "claude-code" {
1515
source = "registry.coder.com/coder/claude-code/coder"
16-
version = "4.1.0"
16+
version = "4.2.0"
1717
agent_id = coder_agent.example.id
1818
workdir = "/home/coder/project"
1919
claude_api_key = "xxxx-xxxxx-xxxx"
@@ -70,7 +70,7 @@ data "coder_parameter" "ai_prompt" {
7070
7171
module "claude-code" {
7272
source = "registry.coder.com/coder/claude-code/coder"
73-
version = "4.1.0"
73+
version = "4.2.0"
7474
agent_id = coder_agent.example.id
7575
workdir = "/home/coder/project"
7676
@@ -106,7 +106,7 @@ Run and configure Claude Code as a standalone CLI in your workspace.
106106
```tf
107107
module "claude-code" {
108108
source = "registry.coder.com/coder/claude-code/coder"
109-
version = "4.1.0"
109+
version = "4.2.0"
110110
agent_id = coder_agent.example.id
111111
workdir = "/home/coder"
112112
install_claude_code = true
@@ -129,7 +129,7 @@ variable "claude_code_oauth_token" {
129129
130130
module "claude-code" {
131131
source = "registry.coder.com/coder/claude-code/coder"
132-
version = "4.1.0"
132+
version = "4.2.0"
133133
agent_id = coder_agent.example.id
134134
workdir = "/home/coder/project"
135135
claude_code_oauth_token = var.claude_code_oauth_token
@@ -202,7 +202,7 @@ resource "coder_env" "bedrock_api_key" {
202202
203203
module "claude-code" {
204204
source = "registry.coder.com/coder/claude-code/coder"
205-
version = "4.1.0"
205+
version = "4.2.0"
206206
agent_id = coder_agent.example.id
207207
workdir = "/home/coder/project"
208208
model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
@@ -259,7 +259,7 @@ resource "coder_env" "google_application_credentials" {
259259
260260
module "claude-code" {
261261
source = "registry.coder.com/coder/claude-code/coder"
262-
version = "4.1.0"
262+
version = "4.2.0"
263263
agent_id = coder_agent.example.id
264264
workdir = "/home/coder/project"
265265
model = "claude-sonnet-4@20250514"

registry/coder/modules/claude-code/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ variable "claude_code_version" {
114114
default = "latest"
115115
}
116116

117+
variable "disable_autoupdater" {
118+
type = bool
119+
description = "Disable Claude Code automatic updates. When true, Claude Code will stay on the installed version."
120+
default = false
121+
}
122+
117123
variable "claude_api_key" {
118124
type = string
119125
description = "The API key to use for the Claude Code server."
@@ -274,6 +280,14 @@ resource "coder_env" "claude_api_key" {
274280
value = var.claude_api_key
275281
}
276282

283+
resource "coder_env" "disable_autoupdater" {
284+
count = var.disable_autoupdater ? 1 : 0
285+
286+
agent_id = var.agent_id
287+
name = "DISABLE_AUTOUPDATER"
288+
value = "1"
289+
}
290+
277291
locals {
278292
# we have to trim the slash because otherwise coder exp mcp will
279293
# set up an invalid claude config

0 commit comments

Comments
 (0)