Skip to content

fix(web): home paths like ~/.claude/CLAUDE.md no longer show under the workspace folder - #39146

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
SoroushRF:fix/home-relative-paths
Nov 19, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
SoroushRF:fix/home-relative-paths

Conversation

@SoroushRF

Copy link
Copy Markdown
Contributor

Problem

When an agent reads or edits a file in the user's home folder and reports the path as ~/..., the work log shows it as a file inside the project. A read of ~/.claude/CLAUDE.md in project demo is grouped as Read demo/~/.claude/CLAUDE.md. The edit row shows demo/~/.claude/CLAUDE.md. The expanded Read output joins the path to the workspace root (<workspace>/demo/~/.claude/CLAUDE.md), which is not a real file.

formatWorkspaceRelativePath and workEntryReadOutput treat any path that does not start with / and is not a Windows drive path as relative to the workspace. @t3tools/shared/path already has isHostPath, which also accepts ~/ and ~\. resolveWorkspaceFilePath already leaves those prefixes alone, because the server expands them. #38510 added ~\ to isHostPath so those paths open as home files.

Change

Both functions now use isHostPath instead of their own "starts with / or is a drive path" check. Home paths are shown as written, with \ normalised to / as before. Paths relative to the workspace and absolute paths behave the same as before.

Scope

  • Only ~/ and ~\ paths change. Windows drive-path display is untouched.
  • Opening a home-path link was already correct: the workspace lookup skips ~/ paths and the file panel accepts them through isHostPath. markdown-links.ts is not changed.
  • A bare ~ (no slash) is still treated as relative, matching isHostPath.

Verification

  • Regression tests come first, in commit 6bc342cf. On that commit alone, two assertions fail, showing t3code/~/.claude/CLAUDE.md and /workspace/t3code/~/.claude/CLAUDE.md. With the fix, filePathDisplay.test.ts, MessagesTimeline.logic.test.ts, markdown-links.test.ts and session-logic.runtime-diagnostics.test.ts pass (136 tests).
  • Real app: scripts/scenarios/home-path-tool-rows-show-as-written.e2e.ts (added with the tests) has a local ACP agent read and then edit ~/.claude/CLAUDE.md. I ran it with e2e run --target web on base 0c1cf54c and on this branch:
    • On base it fails: /~/ appears 3 times.
    • On this branch it passes: the path appears as written in both rows and in the Read output.
Before (main 0c1cf54) After (this branch)
Read demo/~/.claude/CLAUDE.md, Read output under the workspace root, edit row demo/~/.claude/CLAUDE.md Read ~/.claude/CLAUDE.md, Read output ~/.claude/CLAUDE.md, edit row ~/.claude/CLAUDE.md
  • vp run check:changed (Windows): format, lint, knip, typecheck, tests (4 files) and the React Compiler check all pass.

Not checked:

  • macOS and Linux (tested on Windows 11 only).
  • Mobile, which has its own path display code.
  • Markdown file chips with a ~/ path in the real app. They go through the same formatWorkspaceRelativePath, so only the unit test covers them.

Found by Gemini 4 Neon in Antigravity. Implementation, evidence and review: Claude Opus 5.5 in Claude Code, directed by @SoroushRF.

🤖 Generated with Claude Code

SoroushRF and others added 2 commits November 19, 2026 04:19
A path like ~/.claude/CLAUDE.md names a file in the user's home folder,
but the work log treats it as workspace-relative: the row label shows
t3code/~/.claude/CLAUDE.md and the expanded Read output shows
/workspace/t3code/~/.claude/CLAUDE.md. These tests fail on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e workspace folder

formatWorkspaceRelativePath and workEntryReadOutput treated any path
that does not start with / or a drive letter as workspace-relative, so
~/ and ~\ paths got the workspace name or root put in front of them.
Both now use isHostPath, the shared helper that already counts home
paths as host paths, and leave those paths as written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b776136 and 1334a1a.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Path display logic now uses isHostPath to preserve tilde-prefixed paths instead of joining them to the workspace root. Unit and end-to-end tests cover POSIX and Windows-style home paths.

Changes: Home path display

Layer / File(s) Summary
Host-path detection and display validation
apps/web/src/components/chat/MessagesTimeline.logic.ts, apps/web/src/components/chat/MessagesTimeline.logic.test.ts, apps/web/src/filePathDisplay.ts, apps/web/src/filePathDisplay.test.ts, scripts/scenarios/home-path-tool-rows-show-as-written.e2e.ts
Both display functions use isHostPath to determine whether to prefix paths with the workspace root. Tests cover relative paths and tilde-prefixed paths, including Windows-style separators. The end-to-end scenario checks that tool rows display ~/.claude/CLAUDE.md without a project prefix.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#38510: Updates isHostPath to recognize the ~\ prefix, which this PR uses for path detection.

Suggested labels: bugfix

Suggested reviewers: valerazsd, juliusmarminge, macroscopeapp

Merge Risk: Minimal · previous review b7761

Home paths such as ~/.claude/CLAUDE.md are now shown as written instead of under the workspace folder. Other path display behavior is unchanged, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: home paths such as ~/.claude/CLAUDE.md no longer display under the workspace folder. It follows the conventional commit format and matches the code changes to formatWo…
Description check Passed The description follows the template. It covers the problem, the change, scope, and verification. It states the regression tests, the e2e scenario results on base and on the branch, and the checks run…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: home paths such as ~/.claude/CLAUDE.md no longer display under the workspace folder. It follows the conventional commit format and matches the code changes to formatWorkspaceRelativePath and workEntryReadOutput, which now use isHostPath.

Full details: Description check

Explanation

The description follows the template. It covers the problem, the change, scope, and verification. It states the regression tests, the e2e scenario results on base and on the branch, and the checks run on Windows 11. It also lists what was not checked. It has no Problem sentence about the expected behavior in a separate line, but the problem section states it. The Scope section links no issue and does not cite a maintainer request. It gives a reason for the missing issue link only indirectly, so the scope section is partly incomplete. The verification section includes before/after images. It also names the agent and model, as the template requests.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d067a04 and b776136.

Files selected for processing: 5

  • apps/web/src/components/chat/MessagesTimeline.logic.test.ts
  • apps/web/src/components/chat/MessagesTimeline.logic.ts
  • apps/web/src/filePathDisplay.test.ts
  • apps/web/src/filePathDisplay.ts
  • scripts/scenarios/home-path-tool-rows-show-as-written.e2e.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 19, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Created demo/src/app.ts, replayed three Reads and one home-file Edit, then expanded the completed turn, file group, and first Read in the real web client. Both runs used fresh databases, Chromium, 1280×800, and light theme.

Before After
3dff4daf14 1334a1aa2f
Before: home paths incorrectly prefixed with demo After: home paths display without workspace prefixes
Four /~/ occurrences; home Reads and Edit incorrectly appear under demo. Zero /~/ occurrences; ~/.claude/CLAUDE.md and ~/.gitconfig display correctly.

The before capture replaces only the absolute synthetic workspace prefix with for privacy. The incorrect demo/~/ suffix remains visible. The workspace-relative control remains demo/src/app.ts on both sides.

Scenario source. scenarios:prove exited 0.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 19, 2026
@juliusmarminge
juliusmarminge merged commit b6afe81 into pingdotgg:main Nov 19, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 19, 2026
rynfar added a commit to rynfar/t3code that referenced this pull request Nov 20, 2026
…ltas (#453)

* feat(native): port #444 Part B Sidebar, Thread & Transcript parity deltas

Port all remaining Sidebar, Thread View, and Transcript parity deltas from upstream `4121b30..80cf4f7` and flip `TV-LINEAGE` and `TR-WORK` to `done` in `apps/native/parity/LEDGER.md`.

Sidebar (`SB-ROW`, `SB-SECTIONS`, `SB-MENU`, `SB-UNDO`, `SB-SEARCH`, `SB-GROUPING`):
- Regenerating title glimmer (`pingdotgg#29383`)
- Settle-undo position restore via `plan_undo_for_thread` + `UnsettleRestore`/`ReorderActive` (`pingdotgg#33248`)
- Clear opened failed badge in sidebar rows and collapsed folder dots (`pingdotgg#28616`)
- Suppress `Done` badge for stopped/interrupted/cancelled runs (`pingdotgg#37475`)
- 1h snooze clock-minute rounding (`pingdotgg#36785`)
- Opening a delegated task selects its listed parent ancestor (`pingdotgg#37500`)
- Side-chat children included in worktree deletion check (`pingdotgg#36800`)
- Failed message search error state in sidebar search and command palette (`pingdotgg#38155`)
- Jump-hint modifier recheck after hold delay (`pingdotgg#38545`)
- Command palette `Failed` status pill prioritized over background `Waiting` (`pingdotgg#38968`)

Thread & Transcript (`TV-HISTORY`, `TV-LINEAGE`, `TV-FOLLOW`, `TR-WORK`, `TR-MARKDOWN`, `TR-CITE`, `TR-MCPAPP`):
- Subagent history model preservation via `merge_older_subagents` (`pingdotgg#38724`) and hide Resume when `supportsNativeResume` is false without an unsent continuation source (`pingdotgg#39229`)
- Cancel active smooth scroll in `keep_end` so finished-while-away threads open at end (`pingdotgg#38963`)
- MCP PR/CI work-log rows & summaries (`pingdotgg#26751`, `pingdotgg#26752`) and Windows `pwsh`/`powershell`/`cmd` launcher unwrapping (`pingdotgg#38946`)
- Leading-space user markdown preservation (`pingdotgg#38079`), RTL `<details>` and template cards (`pingdotgg#36876`, `pingdotgg#36922`), `Cite` on `send_to_user` rows (`pingdotgg#36858`), home/host paths out of workspace folder (`pingdotgg#39146`), and code/list/email copy serialization fixes (`pingdotgg#36712`, `pingdotgg#36830`, `pingdotgg#36867`, `pingdotgg#36915`, `pingdotgg#37284`, `pingdotgg#39150`)
- MCP app content-block filtering for stripped images (`pingdotgg#31338`), teardown generation race test (`pingdotgg#30387`), and pre-query/fragment download filename derivation (`pingdotgg#30712`)

* fix(native): address PR #453 review findings

Address all 3 review findings from `@d1-reviewer` (`pingdotgg#847`):
1. Remove unwired DOM-HTML Markdown re-serialization helpers (`wrap_inline_code`, `serialize_markdown_anchor`, `escape_markdown_prose`, `ListCopyItem`, `serialize_list_slice`) from `crates/core/src/markdown/clipboard.rs` and update `TR-MARKDOWN` in `apps/native/parity/LEDGER.md` accurately.
2. Add `restore_preserved_leading_whitespace` and wire `user_markdown_view` with a `Copy` (`Cmd+C`) action interceptor (`crates/app/src/transcript/markdown.rs`, `messages.rs`) so user-message Copy and Cite restore ASCII spaces/tabs while preserving literal user-typed NBSPs (`pingdotgg#38079`), verified by GPUI test `user_markdown_copy_restores_leading_spaces_and_preserves_literal_nbsp`.
3. Fetch omitted family side chats via `fetch_family_side_chats` alongside `ORCHESTRATION_GET_WORKTREE_THREAD_IDS` in `delete_thread_then` (`crates/app/src/sidebar/controller.rs`, `pingdotgg#36800`) before calling `has_other_worktree_occupants`, verified by GPUI test `worktree_cleanup_prompt_excludes_omitted_family_side_chats` (and fixed `late_teardown_does_not_close_replacement_host` under `--features snapshot` in `transcript/mcp_app.rs`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants