Skip to content

File visibility, permissions, and Git worktree path issues when operating on Windows mounted directories (/mnt/...) via WSL #16991

Closed as not planned

Description

@cywwycedward

Question

Description
According to the official documentation and best practices of opencode, it is recommended to install the tool in a Linux environment for the best experience. For Windows users, the official recommendation is to use WSL.

However, I am currently facing an issue regarding cross-file-system operations. My project is located in a Windows directory (e.g., drive D:\), and I am accessing it via the mounted path in WSL (e.g., /mnt/d/...).

When opencode performs operations in this mounted directory, I encounter the following problems:

  1. File Visibility: Newly created files by the agent sometimes cannot be found directly or immediately in the Windows directory.
  2. Permission Inconsistencies: There seem to be permission conflicts (POSIX vs NTFS), leading to occasional errors when the agent tries to read/write.
  3. Git Worktree Path Resolution: When the agent creates a git worktree in the mounted directory, it becomes unusable/unviewable on the Windows side. Because it is created inside WSL, the worktree's internal .git configuration stores the absolute WSL path (/mnt/d/...) instead of the Windows path (D:\...). As a result, Windows-based Git clients and editors fail to recognize the paths.

Environment

  • OS: Windows 11 with WSL2 (Ubuntu)
  • Project Location: Windows native drive (accessed via /mnt/d/... in WSL)

Questions

  1. How can I handle the git worktree path mismatch between WSL and Windows? Is there a recommended way to force relative paths or map the paths correctly so that both systems can recognize the worktree?
  2. If my workflow requires keeping the project in the Windows directory, what is the best practice or recommended configuration (e.g., modifying wsl.conf or Git settings) to resolve these issues?

Any guidance or suggestions would be greatly appreciated. Thank you!

Activity

  1. thenie1221 commented on Apr 6, 2026

    @thenie1221

    I have the same question.

  2. rekram1-node commented on Jun 23, 2026

    @rekram1-node
    Contributor

    Automated: closing question issues.

    GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.

    If this is a bug or feature request, please open a new issue with the appropriate template.

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

Metadata

Metadata

Assignees

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