Claude Code project hooks (.claude/settings.json) are no longer run (3.24.9)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

With the third-party setting ON, hooks in /.claude/settings.json (UserPromptSubmit and SessionStart, type command) worked in the Agents Window on an earlier day with 3.24.9: the Hooks output showed “Loaded Claude project hooks”. After a Cursor update, neither hook is called anymore, in the Agents Window or the editor panel. A test hook that only appends a line to a log file never writes it. This holds in old and new workspaces, after reloading and after fully restarting Cursor. The Hooks output lists the Claude project config path but never shows “Loaded Claude project hooks”.

Steps to Reproduce

Impact: we use a UserPromptSubmit hook to block messages containing secrets, and a session-start hook to give the agent context. As a workaround we moved both to .cursor/hooks.json. The blocker works there, but the context only arrives in the editor window, not in the Agents Window.

Expected Behavior

See above.

Operating System

Windows 10/11

Version Information

Version: 3.24.9 (user setup)
VS Code Extension API: 1.128.0
Commit: cd6d2a1f2e56e9841f0ed9c7c24542087b4e69b0
Date: 2026-10-08T05:37:28.393Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26300

For AI issues: which model did you use?

Grok 4.7

Additional Information

Selected Win11 as OS but running Linux containers.

Possibly related: the Hooks output shows the container path with Windows-style backslashes (\workspaces<name>.claude\settings.json) although the workspace runs in a Linux dev container.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @Xexexe, thanks for the report!

I think I know what’s going on with the .claude/settings.json part. Cursor currently only picks up a Claude settings file as a hooks config when the hook entries include a matcher key, and UserPromptSubmit / SessionStart entries usually don’t have one. When none of them do, the file is skipped quietly, which matches what you see in the Hooks output (path listed, never “Loaded Claude project hooks”).

Could you try this?

  1. Open <project>/.claude/settings.json.
  2. Add "matcher": "" to each entry under UserPromptSubmit and SessionStart, for example:
{
  "hooks": {
    "UserPromptSubmit": [
      { "matcher": "", "hooks": [{ "type": "command", "command": "your-command" }] }
    ],
    "SessionStart": [
      { "matcher": "", "hooks": [{ "type": "command", "command": "your-command" }] }
    ]
  }
}
  1. Save the file, then run “Developer: Reload Window”.
  2. Open the Output panel and select “Hooks”.

Does “Loaded Claude project hooks” appear now, and does your test hook write to its log file? If your entries already had a matcher, please paste the hooks block (with anything sensitive removed) and tell us whether the Hooks section of Cursor Settings shows any errors for that file.

That was it, thank you. I added “matcher”: “” to both entries (UserPromptSubmit and SessionStart). A window reload didn’t seem to pick up the change; after fully quitting and reopening Cursor:

  1. Yes, “Loaded Claude project hooks” appears.
  2. Yes, both hooks wrote to their log, and the UserPromptSubmit hook blocked a test message (exit code 2, and its stderr was shown as the block message).
  3. The entries had no matcher before, as you guessed.
  4. No errors for .claude/settings.json. The only ERROR line is “Failed to parse project hooks configuration”, which I describe below.

About that line: it appears while .cursor/hooks.json doesn’t exist, so it looks like a missing file is reported as a parse error.

Suggestion: Claude Code doesn’t need a matcher for these two events, so it would help if Cursor accepted such entries too, or at least logged why a Claude settings file was skipped. That would have saved us a lot of searching.

One more finding while testing, in case it’s useful: when a UserPromptSubmit hook blocks a message (exit code 2), the message stays in the Agents Window chat and is sent to the model with the next message. I tested it with a fake token: after the block, I asked the agent for the last four characters of my previous message, and it gave them. For a secret-blocking hook, that means the block only delays the leak unless the user starts a new chat. I’d expect a blocked message to be left out of what the model receives. Is this intended?

Hey @Xexexe, thanks for confirming, and for testing the blocked-message case too!

You’re right that Claude Code doesn’t need a matcher for UserPromptSubmit and SessionStart, so Cursor shouldn’t require one either. I’ve passed that on to the team, along with your suggestion to log why a Claude settings file was skipped. For now, keeping "matcher": "" on those entries is the way to go. The “Failed to parse project hooks configuration” line is harmless: it shows up when there’s no .cursor/hooks.json in the project, even though nothing failed to parse.

On the blocked message: no, that’s not intended. A blocked prompt currently stays in the chat, and the next message in that same chat can carry it into what the model sees. This is a known issue we’re tracking, and I’ve added your report to it.

Until it’s fixed, either of these keeps a blocked prompt out of the context:

  1. After a block, start a new chat. Nothing from the old chat carries over.
  2. Or click the blocked message, edit out the secret, and resend it. Editing replaces the blocked text instead of sending it along with your next message.