[BUG] file:// URL in /insights output loses backslash before ".claude" when rendered
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When /insights finishes, the response includes a link to the generated HTML report. The rendered output drops the backslash (\) immediately before .claude in the Windows path, producing a visually broken URL.
Observed output in terminal:
Your shareable insights report is ready:
file://C:\Users\Gll.claude\usage-data\report.html
Actual path on disk (correct):
C:\Users\Gll.claude\usage-data\report.html
Note the missing backslash between Gll and .claude in the rendered URL. The file itself is created at the correct path — only the displayed link is wrong, which breaks click-to-open in terminals that linkify file:// URLs.
Likely cause: the renderer interprets \. in the markdown/ANSI output as an escape sequence and strips the backslash. Other Windows paths with \.something would presumably have the same issue.
What Should Happen?
The rendered file:// URL should preserve every backslash in the Windows path exactly as it exists on disk, so that:
- The link is visually correct (
file://C:\Users\Gll\.claude\usage-data\report.html) - Terminals that linkify
file://URLs can open the file directly without a 404
Possible fixes:
- Escape backslashes before rendering (
\\instead of\) - Emit a
file:///URI with forward slashes (file:///C:/Users/Gll/.claude/usage-data/report.html) — this is the RFC 8089 form and sidesteps escape ambiguity - Wrap the path in backticks so it's rendered as inline code and not interpreted as markdown
Error Messages/Logs
No stderr or exception — purely a rendering issue.
Minimal reproduction of rendered vs. actual:
Rendered: file://C:\Users\Gll.claude\usage-data\report.html
Actual: C:\Users\Gll\.claude\usage-data\report.html
^
backslash missing in render
Steps to Reproduce
- Use Claude Code on Windows (path containing
\.claude— the default global config directory). - In any project, run
/insights. - Wait for the report to generate.
- Observe the final message:
Your shareable insights report is ready: file://C:\Users\<user>\.claude\usage-data\report.html
- Copy the rendered URL from the terminal and try to open it — it points to a non-existent path because the backslash before
.claudewas dropped during rendering.
Confirmed with:
- OS: Windows 11
- Shell: PowerShell 7 (pwsh)
- Claude Code installed via Scoop shim (
C:\Users\<user>\.local\bin\claude.EXE)
The same rendering issue likely affects any output that emits a Windows path containing a \. sequence in a markdown/ANSI context — not just /insights.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.118 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
Workarounds I'm using locally:
- In my own slash commands, I wrap Windows paths in backticks when reporting them, which preserves the backslash visually.
- For clickable links, I emit URIs with forward slashes:
file:///C:/Users/Gll/.claude/usage-data/report.html.
Scope guess: any renderer path that processes \. as an escape sequence will hit this. Other commands emitting Windows paths in prose (not in code blocks) probably have the same
issue — e.g., /compact summaries, error messages, tool result summaries.
Not a regression as far as I know — I haven't tested older versions for this specific output.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗