Skip to content

Commit 4fdcf0d

Browse files
authored
fix(coder/modules/claude-code): update claude session workdir normalization (#803)
## Description - This lead to a bug where if the folder name is in the form `a.b.c`: - we check for: `-home-coder-ai.coder.com/cd32e253-ca16-4fd3-9825-d837e74ae3c2.jsonl` - But the actual file path for claude-session is: `-home-coder-ai-coder-com/cd32e253-ca16-4fd3-9825-d837e74ae3c2.jsonl` - The above bug might also occur in the case of `a_b_c` - update workdir normalization to handle dot in path ## 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.8.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 1460293 commit 4fdcf0d

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

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

Lines changed: 9 additions & 9 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.8.0"
16+
version = "4.8.1"
1717
agent_id = coder_agent.main.id
1818
workdir = "/home/coder/project"
1919
claude_api_key = "xxxx-xxxxx-xxxx"
@@ -60,7 +60,7 @@ By default, when `enable_boundary = true`, the module uses `coder boundary` subc
6060
```tf
6161
module "claude-code" {
6262
source = "registry.coder.com/coder/claude-code/coder"
63-
version = "4.8.0"
63+
version = "4.8.1"
6464
agent_id = coder_agent.main.id
6565
workdir = "/home/coder/project"
6666
enable_boundary = true
@@ -81,7 +81,7 @@ For tasks integration with AI Bridge, add `enable_aibridge = true` to the [Usage
8181
```tf
8282
module "claude-code" {
8383
source = "registry.coder.com/coder/claude-code/coder"
84-
version = "4.8.0"
84+
version = "4.8.1"
8585
agent_id = coder_agent.main.id
8686
workdir = "/home/coder/project"
8787
enable_aibridge = true
@@ -110,7 +110,7 @@ data "coder_task" "me" {}
110110
111111
module "claude-code" {
112112
source = "registry.coder.com/coder/claude-code/coder"
113-
version = "4.8.0"
113+
version = "4.8.1"
114114
agent_id = coder_agent.main.id
115115
workdir = "/home/coder/project"
116116
ai_prompt = data.coder_task.me.prompt
@@ -133,7 +133,7 @@ This example shows additional configuration options for version pinning, custom
133133
```tf
134134
module "claude-code" {
135135
source = "registry.coder.com/coder/claude-code/coder"
136-
version = "4.8.0"
136+
version = "4.8.1"
137137
agent_id = coder_agent.main.id
138138
workdir = "/home/coder/project"
139139
@@ -189,7 +189,7 @@ Run and configure Claude Code as a standalone CLI in your workspace.
189189
```tf
190190
module "claude-code" {
191191
source = "registry.coder.com/coder/claude-code/coder"
192-
version = "4.8.0"
192+
version = "4.8.1"
193193
agent_id = coder_agent.main.id
194194
workdir = "/home/coder/project"
195195
install_claude_code = true
@@ -211,7 +211,7 @@ variable "claude_code_oauth_token" {
211211
212212
module "claude-code" {
213213
source = "registry.coder.com/coder/claude-code/coder"
214-
version = "4.8.0"
214+
version = "4.8.1"
215215
agent_id = coder_agent.main.id
216216
workdir = "/home/coder/project"
217217
claude_code_oauth_token = var.claude_code_oauth_token
@@ -284,7 +284,7 @@ resource "coder_env" "bedrock_api_key" {
284284
285285
module "claude-code" {
286286
source = "registry.coder.com/coder/claude-code/coder"
287-
version = "4.8.0"
287+
version = "4.8.1"
288288
agent_id = coder_agent.main.id
289289
workdir = "/home/coder/project"
290290
model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
@@ -341,7 +341,7 @@ resource "coder_env" "google_application_credentials" {
341341
342342
module "claude-code" {
343343
source = "registry.coder.com/coder/claude-code/coder"
344-
version = "4.8.0"
344+
version = "4.8.1"
345345
agent_id = coder_agent.main.id
346346
workdir = "/home/coder/project"
347347
model = "claude-sonnet-4@20250514"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ TASK_SESSION_ID="cd32e253-ca16-4fd3-9825-d837e74ae3c2"
8888

8989
get_project_dir() {
9090
local workdir_normalized
91-
workdir_normalized=$(echo "$ARG_WORKDIR" | tr '/' '-')
91+
workdir_normalized=$(echo "$ARG_WORKDIR" | tr '/._' '-')
9292
echo "$HOME/.claude/projects/${workdir_normalized}"
9393
}
9494

0 commit comments

Comments
 (0)