From ac49e6eef5e62751d83b8a18b092bcf0f242c5eb Mon Sep 17 00:00:00 2001 From: Jason Barnett Date: Tue, 3 Mar 2026 14:28:48 -0700 Subject: [PATCH] docs(claude-code): document pre_install_script for module dependency ordering (#613) ## Summary Clarifies that the existing `pre_install_script` variable can be used to handle dependencies between modules during workspace startup. ## Problem When using multiple startup modules (e.g., git-clone and claude-code), there's a race condition where scripts execute in parallel. Module dependencies need to be managed, such as ensuring git-clone completes before Claude Code tries to access a workdir. ## Solution The existing `pre_install_script` variable already provides this capability. Updated documentation to clarify this use case. ## Example ```hcl module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" workdir = "/path/to/repo" # Wait for git-clone to complete before starting pre_install_script = <<-EOT #!/bin/bash set -e while [ ! -f /tmp/.git-clone-complete ]; do sleep 1 done EOT } ``` Resolves issue #609. Co-authored-by: Jason Barnett Co-authored-by: DevCats --- registry/coder/modules/claude-code/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/coder/modules/claude-code/main.tf b/registry/coder/modules/claude-code/main.tf index 8f517ebc..337ebd20 100644 --- a/registry/coder/modules/claude-code/main.tf +++ b/registry/coder/modules/claude-code/main.tf @@ -67,7 +67,7 @@ variable "cli_app_display_name" { variable "pre_install_script" { type = string - description = "Custom script to run before installing Claude Code." + description = "Custom script to run before installing Claude Code. Can be used for dependency ordering between modules (e.g., waiting for git-clone to complete before Claude Code initialization)." default = null }