/resume writes incorrect path to clipboard on Windows — \. collapsed to . (markdown unescape)
Summary
On Windows, when /resume shows a "resume from another directory" hint and copies the command to clipboard, the path written to the clipboard is missing a backslash before .claude, while the path shown in the terminal output is correct.
This breaks any path containing \.claude\..., because the \ before .claude gets eaten — almost certainly by a markdown-unescape pass that interprets \. as a CommonMark escape (. is in the ASCII punctuation set, so the backslash is dropped).
Environment
- Claude Code: 2.1.142
- OS: Windows 11 Pro 10.0.26200
- Shell: PowerShell 7
- Install: native
claude.exe(single-executable build)
Reproduction
- Have a Claude Code worktree, e.g.
C:\Users\User\.claude\worktrees\<branch> - Start a session inside that worktree, exit
- From a different cwd, run
claudeand type/resume - Pick the worktree session — observe the printed command
Actual
Terminal stdout (correct):
cd 'C:\Users\User\.claude\worktrees\<branch>' && claude --resume <session-id>
(Command copied to clipboard)
Clipboard contents (wrong — Get-Clipboard):
cd 'C:\Users\User.claude\worktrees\<branch>' && claude --resume <session-id>
Notice User.claude instead of User\.claude. Pasting this command into PowerShell fails (Set-Location : Cannot find path).
Expected
Clipboard contents should match the displayed command verbatim, with the backslash intact.
Likely root cause
Two separate codepaths render the same string:
- stdout path prints the literal command and the backslash survives.
- clipboard path appears to run the command through a markdown-to-plaintext step before piping it into
Set-Clipboard. CommonMark's escape rules treat\followed by any ASCII punctuation char (including.) as an escape — the backslash is dropped.
Only paths containing \.<something> are affected. The .claude directory naming convention makes this hit nearly every worktree user on Windows.
Workaround
Manually re-insert the \ before .claude after pasting, or run the printed command directly instead of pasting from clipboard.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗