anthropics / anthropics/claude-code

/insights: clicking the report link shows 'Couldn't find this file' when file is outside the working directory

Đang mở
#93,355 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:desktop bug platform:linux
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

## Bug report

**Command:** `/insights`

**What happens:**
The `/insights` slash command generates a usage report and returns a `file://` link to the HTML file (e.g. `file:///home/user/.claude/usage-data/report-YYYY-MM-DD-HHMMSS.html`).

When the user clicks that link inside the Claude desktop app (Code tab), the app shows:

> **Couldn't find this file**
> It may have been deleted, or it lives outside the working directory.

The file exists on disk and is readable; the problem is that the app only resolves links that are relative to the current working directory (or within it). Because `/insights` stores the report under `~/.claude/usage-data/` — outside any project folder — the link is always broken when the session has no project folder open (scratch workspace) or when the project folder is elsewhere.

**Environment:**
- Claude desktop app (Code tab), Linux
- Session working directory: scratch workspace (no project folder)
- Report path: `/home/user/.claude/usage-data/report-*.html`

**Expected behaviour:**
Clicking the link opens the HTML report, regardless of whether the file is inside or outside the current working directory.

**Suggested fixes (pick one):**
1. Resolve `file://` absolute paths in the desktop app without restricting to the working directory.
2. Have `/insights` copy or symlink the report into a location always accessible (e.g. a temp HTTP server, or the scratch workspace).
3. Open the report automatically in the system browser instead of rendering an in-app link.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start at the /insights command entry point and trace where the report is written under ~/.claude/usage-data/ and where its file:// link is produced. Then inspect the desktop app's handling of absolute file links outside the working directory; done means the generated report opens from a scratch session or a different project folder.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
cli, desktop
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.