Skip to content

Commit e4606c5

Browse files
authored
feat(coder/modules/claude-code): update claude to use binary installation for specific version pinning (#681)
## Description - Update claude-code module to use binary installation incase of specific version pinning unless use npm is specified. - Add a deprecation warning in the install script and readme for npm. ## 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.7.1` **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 3b6246f commit e4606c5

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

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

Lines changed: 14 additions & 11 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.7.0"
16+
version = "4.7.1"
1717
agent_id = coder_agent.main.id
1818
workdir = "/home/coder/project"
1919
claude_api_key = "xxxx-xxxxx-xxxx"
@@ -47,7 +47,7 @@ By default, when `enable_boundary = true`, the module uses `coder boundary` subc
4747
```tf
4848
module "claude-code" {
4949
source = "registry.coder.com/coder/claude-code/coder"
50-
version = "4.7.0"
50+
version = "4.7.1"
5151
agent_id = coder_agent.main.id
5252
workdir = "/home/coder/project"
5353
enable_boundary = true
@@ -68,7 +68,7 @@ For tasks integration with AI Bridge, add `enable_aibridge = true` to the [Usage
6868
```tf
6969
module "claude-code" {
7070
source = "registry.coder.com/coder/claude-code/coder"
71-
version = "4.7.0"
71+
version = "4.7.1"
7272
agent_id = coder_agent.main.id
7373
workdir = "/home/coder/project"
7474
enable_aibridge = true
@@ -97,7 +97,7 @@ data "coder_task" "me" {}
9797
9898
module "claude-code" {
9999
source = "registry.coder.com/coder/claude-code/coder"
100-
version = "4.7.0"
100+
version = "4.7.1"
101101
agent_id = coder_agent.main.id
102102
workdir = "/home/coder/project"
103103
claude_api_key = "xxxx-xxxxx-xxxx"
@@ -113,20 +113,23 @@ module "claude-code" {
113113
This example shows additional configuration options for version pinning, custom models, and MCP servers.
114114

115115
> [!NOTE]
116-
> When a specific `claude_code_version` (other than "latest") is provided, the module will install Claude Code via npm instead of the official installer. This allows for version pinning. The `claude_binary_path` variable can be used to specify where a pre-installed Claude binary is located.
116+
> The `claude_binary_path` variable can be used to specify where a pre-installed Claude binary is located.
117+
118+
> [!WARNING]
119+
> **Deprecation Notice**: The npm installation method (`install_via_npm = true`) will be deprecated and removed in the next major release. Please use the default binary installation method instead.
117120
118121
```tf
119122
module "claude-code" {
120123
source = "registry.coder.com/coder/claude-code/coder"
121-
version = "4.7.0"
124+
version = "4.7.1"
122125
agent_id = coder_agent.main.id
123126
workdir = "/home/coder/project"
124127
125128
claude_api_key = "xxxx-xxxxx-xxxx"
126129
# OR
127130
claude_code_oauth_token = "xxxxx-xxxx-xxxx"
128131
129-
claude_code_version = "2.0.62" # Pin to a specific version (uses npm)
132+
claude_code_version = "2.0.62" # Pin to a specific version
130133
claude_binary_path = "/opt/claude/bin" # Path to pre-installed Claude binary
131134
agentapi_version = "0.11.4"
132135
@@ -174,7 +177,7 @@ Run and configure Claude Code as a standalone CLI in your workspace.
174177
```tf
175178
module "claude-code" {
176179
source = "registry.coder.com/coder/claude-code/coder"
177-
version = "4.7.0"
180+
version = "4.7.1"
178181
agent_id = coder_agent.main.id
179182
workdir = "/home/coder/project"
180183
install_claude_code = true
@@ -196,7 +199,7 @@ variable "claude_code_oauth_token" {
196199
197200
module "claude-code" {
198201
source = "registry.coder.com/coder/claude-code/coder"
199-
version = "4.7.0"
202+
version = "4.7.1"
200203
agent_id = coder_agent.main.id
201204
workdir = "/home/coder/project"
202205
claude_code_oauth_token = var.claude_code_oauth_token
@@ -269,7 +272,7 @@ resource "coder_env" "bedrock_api_key" {
269272
270273
module "claude-code" {
271274
source = "registry.coder.com/coder/claude-code/coder"
272-
version = "4.7.0"
275+
version = "4.7.1"
273276
agent_id = coder_agent.main.id
274277
workdir = "/home/coder/project"
275278
model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
@@ -326,7 +329,7 @@ resource "coder_env" "google_application_credentials" {
326329
327330
module "claude-code" {
328331
source = "registry.coder.com/coder/claude-code/coder"
329-
version = "4.7.0"
332+
version = "4.7.1"
330333
agent_id = coder_agent.main.id
331334
workdir = "/home/coder/project"
332335
model = "claude-sonnet-4@20250514"

registry/coder/modules/claude-code/scripts/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ function install_claude_code_cli() {
9393
return
9494
fi
9595

96-
# Use npm when install_via_npm is true or for specific version pinning
97-
if [ "$ARG_INSTALL_VIA_NPM" = "true" ] || { [ -n "$ARG_CLAUDE_CODE_VERSION" ] && [ "$ARG_CLAUDE_CODE_VERSION" != "latest" ]; }; then
96+
# Use npm when install_via_npm is true
97+
if [ "$ARG_INSTALL_VIA_NPM" = "true" ]; then
98+
echo "WARNING: npm installation method will be deprecated and removed in the next major release."
9899
echo "Installing Claude Code via npm (version: $ARG_CLAUDE_CODE_VERSION)"
99100
npm install -g "@anthropic-ai/claude-code@$ARG_CLAUDE_CODE_VERSION"
100101
echo "Installed Claude Code via npm. Version: $(claude --version || echo 'unknown')"

0 commit comments

Comments
 (0)