Hooks and \\wsl$\Debian... path

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Opening a WSL project folder from Windows via a UNC path (\\wsl$\<distro>\...) loads .cursor/hooks.json correctly, but hook execution always fails.

Steps to Reproduce

  1. On Windows, open Cursor without connecting through the WSL extension.
  2. Open a folder on the WSL filesystem via UNC, e.g.
    \\wsl$\Debian12\home\dev\src\Saint-Etienne
  3. Confirm the warning:
    “Opening a WSL folder without using the WSL extension is not recommended”.
  4. Ensure the project has .cursor/hooks.json with at least one sessionStart / workspaceOpen hook, for example:
{
  "version": 1,
  "hooks": {
    "sessionStart": [
      {
        "command": ".cursor/TestHook --event OnSessionStart",
        "timeout": 30
      }
    ],
    "workspaceOpen": [
      {
        "command": ".cursor/TestHook --event OnWorkspaceOpen",
        "timeout": 30
      }
    ]
  }
}
  1. Reload the window / start a new agent session so hooks run.
  2. Open Output → Hooks, or the log file under
    %APPDATA%\Cursor\logs\<session>\window*\output_*\cursor.hooks.workspaceId-*.log

Expected Behavior

  • Workspace root and hook cwd should preserve the full UNC path
    (\\wsl$\Debian12\home\dev\src\Saint-Etienne), or
  • Cursor should refuse/disable project hooks with a clear error when the workspace is opened via unsupported \\wsl$\... access, or
  • Preferentially: require / redirect to WSL remote mode where Linux hooks can run correctly.

Hook spawn should not fail with a false powershell.exe ENOENT.

Operating System

Windows 10/11
Linux

Version Information

Product: Cursor
Version: 3.29.9
OS: Windows 10/11 (win32 10.0.26200) + WSL2 (Debian)
Date observed: 2026-11-05

Does this stop you from using Cursor

No - Cursor works, but with this issue

bug-report-wsl-unc-hooks.md.txt (4.8 KB)

  • Bug report generated by Cursor

Hi @Dmitry_Vinogradov, for Linux hooks like this, the way to get them running is to open the project through the WSL extension rather than the \\wsl$\ path. In a WSL window, hooks run inside the distro, so .cursor/TestHook gets a proper Linux cwd.

  1. Open the Command Palette (Ctrl+Shift+P) and run WSL: Connect to WSL (pick Debian12 if asked).
  2. In the new window, use File → Open Folder and open /home/dev/src/Saint-Etienne.
  3. Reload or start a new agent session and check Output → Hooks.

You can also run cursor . from a WSL terminal in that folder.

On the UNC path itself: hooks are given the path without the \\wsl$ part, so the working directory doesn’t exist and you get the misleading powershell.exe ENOENT. I’ve passed this to the team along with your suggestion to show a clear message for this case instead.