Skip to content

Commit 1384fd6

Browse files
committed
refactor(claude-code): move module_directory to $HOME/.coder-modules/claude-code
Follow the shared convention proposed in #782 for stable per-module persistent storage. coder-utils threads this value through into the generated pre_install, install, and post_install wrapper scripts, so scripts and logs now live at $HOME/.coder-modules/claude-code/ instead of $HOME/.claude-module/. Namespacing under $HOME/.coder-modules/ keeps $HOME from getting polluted with one dotdir per module when a workspace uses several, and matches what boundary, tasks, and agentapi are standardizing on. Updates the README troubleshooting block and the 8 log-path expectations in the bun test suite to match. Related to #782.
1 parent 6534587 commit 1384fd6

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,12 @@ resource "coder_script" "wait_for_claude" {
365365

366366
## Troubleshooting
367367

368-
Module logs live at `$HOME/.claude-module/`:
368+
Module logs live at `$HOME/.coder-modules/claude-code/`:
369369

370370
```bash
371-
cat $HOME/.claude-module/install.log
372-
cat $HOME/.claude-module/pre_install.log
373-
cat $HOME/.claude-module/post_install.log
371+
cat $HOME/.coder-modules/claude-code/install.log
372+
cat $HOME/.coder-modules/claude-code/pre_install.log
373+
cat $HOME/.coder-modules/claude-code/post_install.log
374374
```
375375

376376
## Upgrading from v4.x

registry/coder/modules/claude-code/main.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ describe("claude-code", async () => {
182182
await runModuleScripts(id);
183183
const installLog = await readFileContainer(
184184
id,
185-
"/home/coder/.claude-module/install.log",
185+
"/home/coder/.coder-modules/claude-code/install.log",
186186
);
187187
expect(installLog).toContain("ARG_INSTALL_CLAUDE_CODE");
188188
expect(installLog).toContain("Skipping Claude Code installation");
@@ -201,7 +201,7 @@ describe("claude-code", async () => {
201201
const resp = await execContainer(id, [
202202
"bash",
203203
"-c",
204-
"cat /home/coder/.claude-module/install.log",
204+
"cat /home/coder/.coder-modules/claude-code/install.log",
205205
]);
206206
expect(resp.stdout).toContain(version_to_install);
207207
});
@@ -270,7 +270,7 @@ describe("claude-code", async () => {
270270
expect(resp.exitCode).toBe(0);
271271
const installLog = await readFileContainer(
272272
id,
273-
"/home/coder/.claude-module/install.log",
273+
"/home/coder/.coder-modules/claude-code/install.log",
274274
);
275275
expect(installLog).toContain("claude binary not found on PATH");
276276
});
@@ -300,7 +300,7 @@ describe("claude-code", async () => {
300300
expect(resp.exitCode).not.toBe(0);
301301
const installLog = await readFileContainer(
302302
id,
303-
"/home/coder/.claude-module/install.log",
303+
"/home/coder/.coder-modules/claude-code/install.log",
304304
);
305305
expect(installLog).toContain(
306306
"MCP configuration was provided but the claude binary is not on PATH",
@@ -325,7 +325,7 @@ describe("claude-code", async () => {
325325

326326
const installLog = await readFileContainer(
327327
id,
328-
"/home/coder/.claude-module/install.log",
328+
"/home/coder/.coder-modules/claude-code/install.log",
329329
);
330330
expect(installLog).toContain("claude mcp add-json --scope user");
331331
expect(installLog).toContain("test-server");
@@ -349,7 +349,7 @@ describe("claude-code", async () => {
349349

350350
const installLog = await readFileContainer(
351351
id,
352-
"/home/coder/.claude-module/install.log",
352+
"/home/coder/.coder-modules/claude-code/install.log",
353353
);
354354

355355
expect(installLog).toContain(failingUrl);
@@ -397,13 +397,13 @@ describe("claude-code", async () => {
397397

398398
const preInstallLog = await readFileContainer(
399399
id,
400-
"/home/coder/.claude-module/pre_install.log",
400+
"/home/coder/.coder-modules/claude-code/pre_install.log",
401401
);
402402
expect(preInstallLog).toContain("claude-pre-install-script");
403403

404404
const postInstallLog = await readFileContainer(
405405
id,
406-
"/home/coder/.claude-module/post_install.log",
406+
"/home/coder/.coder-modules/claude-code/post_install.log",
407407
);
408408
expect(postInstallLog).toContain("claude-post-install-script");
409409
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ locals {
7878
# [A-Za-z0-9+/=], so an attacker-controlled string value (e.g. a template
7979
# parameter forwarded into `claude_code_version`) cannot break out of the
8080
# single-quoted shell literal. coder-utils takes the combined string,
81-
# writes it to $HOME/.claude-module/install.sh, and runs it. One file on
81+
# writes it to $HOME/.coder-modules/claude-code/install.sh, and runs it. One file on
8282
# disk, one base64 round-trip, no /tmp wrapper.
8383
install_script = join("\n", [
8484
"#!/bin/bash",
@@ -111,7 +111,7 @@ module "coder-utils" {
111111

112112
agent_id = var.agent_id
113113
agent_name = "claude-code"
114-
module_directory = "$HOME/.claude-module"
114+
module_directory = "$HOME/.coder-modules/claude-code"
115115

116116
display_name_prefix = "Claude Code"
117117
icon = "/icon/claude.svg"

0 commit comments

Comments
 (0)