Skip to content

Conversation

@DevelopmentCats
Copy link
Contributor

Description

Adds a claude_path variable to override the path that the coder_env sets for claude-code.

Model now uses coder_env to set the ANTHROPIC_MODEL env instead of using the --model cli flag which did not set the anthropic model globally in the workspace.

Type of Change

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

Module Information

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

Testing & Validation

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

Related Issues

Copilot AI review requested due to automatic review settings December 19, 2025 15:33
Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

LGTM. Just a few nits.

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 refactors the claude-code module to use environment variables for model configuration instead of CLI flags, and adds a new input variable for custom PATH configuration.

  • Model configuration now uses ANTHROPIC_MODEL environment variable via coder_env resource instead of --model CLI flag
  • Added claude_path variable to allow custom PATH configuration for the Claude Code binary
  • Removed ARG_MODEL parameter and related CLI flag handling from start script

Reviewed changes

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

File Description
registry/coder/modules/claude-code/main.tf Added claude_path variable and anthropic_model coder_env resource; removed ARG_MODEL parameter from start script invocation; updated model variable description
registry/coder/modules/claude-code/scripts/start.sh Removed ARG_MODEL variable declaration, debug print, and --model CLI flag handling
registry/coder/modules/claude-code/main.test.ts Updated test to verify ANTHROPIC_MODEL environment variable is set via coder_env instead of checking for --model CLI flag
registry/coder/modules/claude-code/README.md Updated all version references from 4.2.7 to 4.3.0

Comment on lines 201 to 205
variable "claude_path" {
type = string
description = "Path to prepend to PATH for Claude Code binary."
default = "$HOME/.local/bin"
}
Copy link
Member

Choose a reason for hiding this comment

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

How are you ensuring this is the same path used in the install script? There is a chance these two can drift.

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.

2 participants