claude-code - 💡(How to fix) Fix /resume writes incorrect path to clipboard on Windows — \. collapsed to . (markdown unescape)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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).

Root Cause

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).

Fix Action

Workaround

Manually re-insert the \ before .claude after pasting, or run the printed command directly instead of pasting from clipboard.

Code Example

cd 'C:\Users\User\.claude\worktrees\<branch>' && claude --resume <session-id>

  (Command copied to clipboard)

---

cd 'C:\Users\User.claude\worktrees\<branch>' && claude --resume <session-id>
RAW_BUFFERClick to expand / collapse

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

  1. Have a Claude Code worktree, e.g. C:\Users\User\.claude\worktrees\<branch>
  2. Start a session inside that worktree, exit
  3. From a different cwd, run claude and type /resume
  4. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix /resume writes incorrect path to clipboard on Windows — \. collapsed to . (markdown unescape)