Skip to content

Conversation

@scarf005
Copy link
Contributor

@scarf005 scarf005 commented Jan 6, 2026

Summary

  • Show clean relative paths for files inside the worktree
  • Show absolute paths for files outside the worktree instead of ugly ../../../../../../ paths

Changes

Modified the read tool to check if a file is within the worktree before deciding how to display the path:

  • Inside worktree: Show relative path (e.g., src/tool/read.ts)
  • Outside worktree: Show absolute path (e.g., /home/user/other/file.ts)

This improves UX by avoiding confusing paths like read ../../../../../../home/scarf/foo/bar/baz.ts.

Testing

Verified that lsp_diagnostics passes on the modified file.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

The following comment was made by an LLM, it may be inaccurate:

Duplicate PR Search Results

Good news! I found no duplicate PRs addressing the same issue.

The searches returned several related PRs dealing with file paths and permissions, but these are addressing different concerns:

PR #7015 appears to be unique in addressing the specific issue of normalizing file paths in read tool output to show clean relative paths for files inside the worktree and absolute paths for files outside it.

@aspiers
Copy link
Contributor

aspiers commented Jan 6, 2026

Great idea, this is a big improvement! 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants