Skip to content

fix(coder/modules/claude-code): update claude session workdir normalization#803

Merged
DevelopmentCats merged 3 commits intomainfrom
35C4n0r/fix-claude-session-id-exists-bug
Mar 13, 2026
Merged

fix(coder/modules/claude-code): update claude session workdir normalization#803
DevelopmentCats merged 3 commits intomainfrom
35C4n0r/fix-claude-session-id-exists-bug

Conversation

@35C4n0r
Copy link
Copy Markdown
Collaborator

@35C4n0r 35C4n0r commented Mar 13, 2026

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
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

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

Testing & Validation

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

Related Issues

@35C4n0r 35C4n0r requested a review from DevelopmentCats March 13, 2026 17:17
@35C4n0r 35C4n0r self-assigned this Mar 13, 2026
@35C4n0r 35C4n0r changed the title fix(coder/modules/claude-code): update workdir normalization to handle dot in path fix(coder/modules/claude-code): update claude session workdir normalization Mar 13, 2026
@DevelopmentCats DevelopmentCats requested a review from Copilot March 13, 2026 17:32
Copy link
Copy Markdown
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

Fixes Claude session directory lookup for workdirs containing dots/underscores by aligning the module’s workdir normalization with Claude’s on-disk project directory naming.

Changes:

  • Update start.sh workdir normalization to replace /, ., and _ with - when deriving ~/.claude/projects/<normalized>.
  • Bump README Terraform examples from 4.8.0 to 4.8.1.

Reviewed changes

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

File Description
registry/coder/modules/claude-code/scripts/start.sh Adjusts project directory normalization so task/session discovery works for paths containing . and _.
registry/coder/modules/claude-code/README.md Updates example module version pins to 4.8.1.

Comment thread registry/coder/modules/claude-code/scripts/start.sh
Comment thread registry/coder/modules/claude-code/scripts/start.sh
Copy link
Copy Markdown
Collaborator

@DevelopmentCats DevelopmentCats left a comment

Choose a reason for hiding this comment

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

LGTM

@DevelopmentCats DevelopmentCats added the version:patch Add to PRs requiring a patch version upgrade label Mar 13, 2026
@DevelopmentCats DevelopmentCats merged commit 4fdcf0d into main Mar 13, 2026
9 checks passed
@DevelopmentCats DevelopmentCats deleted the 35C4n0r/fix-claude-session-id-exists-bug branch March 13, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:patch Add to PRs requiring a patch version upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants