From 446ba1fc6bd92bb39c7a3315ef2941319f6b49b7 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Thu, 30 Apr 2026 21:22:45 +0530 Subject: [PATCH] feat(claude-code): add module_directory variable and update module path references --- registry/coder/modules/claude-code/main.tf | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/claude-code/main.tf b/registry/coder/modules/claude-code/main.tf index acfe8538..48199e85 100644 --- a/registry/coder/modules/claude-code/main.tf +++ b/registry/coder/modules/claude-code/main.tf @@ -130,6 +130,12 @@ variable "telemetry" { description = "Configure Claude Code OpenTelemetry export. When enabled, sets CLAUDE_CODE_ENABLE_TELEMETRY and the standard OTEL_EXPORTER_OTLP_* environment variables. Coder workspace identifiers (coder.workspace_id, coder.workspace_name, coder.workspace_owner, coder.template_name) are automatically appended to OTEL_RESOURCE_ATTRIBUTES so Claude Code telemetry can be joined with Coder audit and exectrace logs." } +variable "module_directory" { + type = string + description = "The directory where the module is installed. Defaults to $HOME/.coder-modules/coder/claude-code." + default = "$HOME/.coder-modules/coder/claude-code" +} + resource "coder_env" "claude_code_oauth_token" { count = var.claude_code_oauth_token != "" ? 1 : 0 agent_id = var.agent_id @@ -238,7 +244,6 @@ locals { ARG_MCP_CONFIG_REMOTE_PATH = base64encode(jsonencode(var.mcp_config_remote_path)) ARG_ENABLE_AI_GATEWAY = tostring(var.enable_ai_gateway) }) - module_dir_name = ".coder-modules/coder/claude-code" } module "coder_utils" { @@ -246,7 +251,7 @@ module "coder_utils" { version = "0.0.1" agent_id = var.agent_id - module_directory = "$HOME/${local.module_dir_name}" + module_directory = var.module_directory display_name_prefix = "Claude Code" icon = var.icon pre_install_script = var.pre_install_script @@ -261,3 +266,11 @@ output "scripts" { description = "Ordered list of coder exp sync names for the coder_script resources this module actually creates, in run order (pre_install, install, post_install). Scripts that were not configured are absent from the list." value = module.coder_utils.scripts } + +output "agent_reference" { + value = { + agent_ref = "claude-code" + agent_module_dir = var.module_directory + agent_binary_path = concat(var.claude_binary_path, "/claude") + } +}