openai / openai/codex-plugin-cc
transfer: stale Claude transcript path after session enters a worktree
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 33.3k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Summary
/codex:transfer fails after a Claude Code session creates or enters a Git worktree because the Codex plugin keeps the transcript path recorded at SessionStart. Claude subsequently stores the same session ID under the worktree-specific project directory.
Environment
- Claude Code:
2.1.210 - codex-plugin-cc:
1.0.5 - Linux
- Git worktree workflow via Claude Code
Reproduction
- Start Claude Code in a repository root.
- In that same Claude session, create or enter a Git worktree.
- Run
/codex:transfer.
The plugin invokes transfer using the CODEX_COMPANION_TRANSCRIPT_PATH value written by its SessionStart hook.
Actual result
The environment value still points at the original project directory, for example:
~/.claude/projects/-home-...-sh-backend-api/<session-id>.jsonl
That file no longer exists. The real transcript with the exact same session UUID is stored at:
~/.claude/projects/-home-...-sh-backend-api--worktrees-SH-5471/<session-id>.jsonl
Transfer therefore fails with:
Claude session file not found: ~/.claude/projects/.../<session-id>.jsonl
Passing the real path explicitly works around this particular stale-path lookup. Long absolute paths are also easy to accidentally split across lines in the slash command, producing a misleading must be a JSONL file error; that is secondary to the stale automatic lookup.
Expected result
/codex:transfer should transfer the current session after Claude enters a worktree, without requiring users to find the JSONL path manually.
Suggested fix
In resolveClaudeSessionPath(), when CODEX_COMPANION_TRANSCRIPT_PATH is missing:
- Take its basename/session UUID.
- Search only under
~/.claude/projectsfor the exact<session-id>.jsonl. - Use the result only if exactly one matching file exists; otherwise retain the current error and show candidate paths or require
--source.
This is deterministic, preserves the current security boundary, and handles Claude worktree-specific project-directory naming.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at resolveClaudeSessionPath() and inspect how the session UUID and ~/.claude/projects path are handled when the transcript environment value is unavailable. Reproduce the Git worktree case, then verify that exactly one matching JSONL is selected and that ambiguous or missing matches retain the current error with useful candidates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, javascript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100