workspaceOpen hook is registered and requested, but the command script never runs (Linux, 3.7.27)

Environment

  • OS: Linux (x64)
  • Cursor version: 3.7.27 (e48ee6102a199492b0c9964699bf011886708ba0)
  • Workspace: single-folder project, also tested with a multi-root .code-workspace
  • Workspace trust: trusted

Goal

Use a minimal workspaceOpen hook to run a script when the workspace opens.

Setup

.cursor/hooks.json:

{
  "version": 1,
  "hooks": {
    "workspaceOpen": [
      {
        "command": ".cursor/hooks/hello-world.sh",
        "timeout": 60
      }
    ]
  }
}

.cursor/hooks/hello-world.sh:

#!/bin/bash
echo "hello from workspaceOpen" >> /tmp/cursor-workspace-open-test.log
echo '{"pluginPaths":[]}'

The script is executable (chmod +x).

Manual test (works)


printf '{"workspace_roots":["/path/to/workspace"]}' \
| CURSOR_PROJECT_DIR=/path/to/workspace .cursor/hooks/hello-world.sh

Result:

/tmp/cursor-workspace-open-test.log contains: hello from workspaceOpen

What happens in Cursor

From Output → Hooks after a full quit and reopen:

Loaded 1 project hook(s) for steps: workspaceOpen

Hook step requested: workspaceOpen

Hook step requested: workspaceOpen

But /tmp/cursor-workspace-open-test.log is not created or updated. The script does not appear to run.

What I tried

Command format Result
.cursor/hooks/hello-world.sh Hook registered, script not executed
bash .cursor/hooks/hello-world.sh Same
sh -c '"$CURSOR_PROJECT_DIR/.cursor/hooks/hello-world.sh"' Same

In all cases: config loads, workspaceOpen is requested, but no log file, no stdout side effects.

Questions: Is workspaceOpen command execution supported on Linux in 3.7.27?

Hey, thanks for the detailed report. Your config and manual test look correct, workspaceOpen should run your command, so your expectation is right.

3.7.27 is a pretty old build, and workspaceOpen was added fairly recently with a few fixes since then. This looks like a version-specific gap where the hook gets registered and requested, but the script never actually runs.

Can you update to the latest Cursor version and retry? If the script still doesn’t run:

  • Send the full output from Output → Hooks on startup, not trimmed. Include the whole block around Loaded ... project hook(s) and Hook step requested.
  • Confirm whether .cursor/hooks.json is in the first folder of the workspace. Multi-root workspaces had a couple quirks around discovering project hooks.

If it still reproduces on the latest build, I’ll file a bug and come back here with an update.

@deanrie , I updated cursor to version 3.8.11, it still not work
I simplify the test to a single root project.

And the log is here

[2026-06-19T11:59:59.720Z] Initializing Cursor Hooks Service...
[2026-06-19T11:59:59.732Z] Claude user config path: /home/jmst/.claude/settings.json
[2026-06-19T11:59:59.733Z] Project config path (test-hook): /home/jmst/wrk/myGitHub/tmp/test-hook/.cursor/hooks.json
[2026-06-19T11:59:59.733Z] Claude project config path (test-hook): /home/jmst/wrk/myGitHub/tmp/test-hook/.claude/settings.json
[2026-06-19T11:59:59.733Z] Claude project local config path (test-hook): /home/jmst/wrk/myGitHub/tmp/test-hook/.claude/settings.local.json
[2026-06-19T11:59:59.763Z] User config path: /home/jmst/.cursor/hooks.json
[2026-06-19T11:59:59.763Z] Enterprise config path: file:///etc/cursor/hooks.json
[2026-06-19T11:59:59.764Z] Reloading hooks configuration...
[2026-06-19T11:59:59.785Z] No Claude user settings found
[2026-06-19T12:00:29.389Z] No enterprise hooks configuration found
[2026-06-19T12:00:29.616Z] No user hooks configuration found
[2026-06-19T12:00:29.796Z] Loaded 1 project hook(s) for steps: workspaceOpen
[2026-06-19T12:00:29.796Z] Reloading hooks configuration...
[2026-06-19T12:00:29.798Z] Refreshing team hooks...
[2026-06-19T12:00:29.798Z] Cursor Hooks Service initialized successfully
[2026-06-19T12:00:29.799Z] Hook step requested: workspaceOpen
[2026-06-19T12:00:29.800Z] Hook step requested: workspaceOpen
[2026-06-19T12:00:29.819Z] No Claude user settings found
[2026-06-19T12:00:31.135Z] No enterprise hooks configuration found
[2026-06-19T12:00:31.138Z] No user hooks configuration found
[2026-06-19T12:00:31.168Z] Loaded 1 project hook(s) for steps: workspaceOpen

Thanks for updating and capturing a clean log. It shows the same signature: the hook loads (Loaded 1 project hook(s)) and gets requested (Hook step requested: workspaceOpen), but there isn’t a single line after that about running the script. That means the command isn’t actually being spawned. Since this reproduces on 3.8.11 with a minimal single-root setup, it’s not an old-version issue.

I’m going to log this as a bug on our side (Linux, workspaceOpen command hook doesn’t run). I can’t share an ETA for a fix yet. Once I have an update, I’ll reply here.

A couple quick questions to add to the report:

  • Do you actually have the file /etc/cursor/hooks.json, or is that just a path we check? In the log there’s about a 30-second pause before No enterprise hooks configuration found, and I want to confirm it’s not affecting anything.
  • What do you see in Settings → Hooks for this project? Does the hook show up there without any validation errors?

If anything else comes up, let me know, but I’ll file the report now.