Skip to content

read_file/str_replace do not expand leading ~ (resolves under /app/~) #6270

Closed

Description

@salman1993

Problem

The dev-mcp read_file / str_replace tools do not expand a leading ~. In resolve_path (crates/buzz-dev-mcp/src/paths.rs), a path is only ever treated as absolute or joined onto the workspace root. A tilde path like ~/.claude/skills/x is not absolute, so it resolves to <workdir>/~/.claude/... (e.g. /app/~/.claude/...), which never exists.

Observed in the PR #6261 named-path benchmark: all five agents initially passed a literal ~ to read_file, which resolved incorrectly under /app/~. Every agent recovered, but the tool ergonomics are wrong — the shell tool expands ~ via bash, so the file tools diverge from it.

Fix

Expand a leading ~ (bare ~ or ~/...) to the user home directory ($HOME, %USERPROFILE% on Windows) at the single chokepoint resolve_path, matching shell semantics. ~user (another user home) is intentionally not handled — it needs a passwd lookup and is out of scope, consistent with the conservative posture for un-mappable MSYS forms.

Activity

  1. added a commit that references this issue on Aug 19, 2026
    90dff21
  2. added a commit that references this issue on Aug 19, 2026
    7f69b13
  3. added a commit that references this issue on Aug 23, 2026
    eec6a81
  4. added a commit that references this issue on Aug 25, 2026
    6f171c0
  5. added a commit that references this issue on Sep 2, 2026
    f761a79
  6. added a commit that references this issue on Oct 7, 2026
    2dce8e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions