Skip to content

## open_file: Auto-convert paths between Windows and WSL formats #1

Description

@toalba

Problem

When Claude Code runs in a WSL bash shell, all file paths it works with are Linux-style (/mnt/c/Users/...). When calling open_file on a local (non-WSL-Remote) VSCode session, these paths fail silently — Pylon tries to resolve them as vscode-remote://wsl+ubuntu/c:\Users\... which doesn't exist.

The caller has to know which path format each session expects, which is error-prone and leads to confusing failures (tool reports success but nothing opens).

Expected behavior

open_file should automatically convert paths based on the session's context:

  • Local session receiving /mnt/c/Users/jane/project/src/app.py → convert to C:\Users\jane\project\src\app.py
  • WSL-Remote session receiving C:\Users\jane\project\src\app.py → convert to /mnt/c/Users/jane/project/src/app.py

This is possible because the extension knows its own context via vscode.env.remoteName (undefined = local, wsl = WSL-Remote, ssh-remote = SSH).

Proposed solution

Option A (recommended): Path auto-conversion in open_file

  • Detect session type
  • If local + path starts with /mnt/c/ → convert to C:\...
  • If WSL + path starts with C:\ → convert to /mnt/c/...

Option B (additive): Expose session type in terminal_list_sessions

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions