Hooks double fire in Windows CLI

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Hooks that are installed and run through the standard file ~/.cursor/hooks.json double fire in the Windows CLI

Steps to Reproduce

Install a hook in ~/.cursor/hooks.json
Perform the action

Expected Behavior

Hooks should single fire

Operating System

Windows 10/11

Version Information

About Cursor CLI

CLI Version 2026.04.08-a41fba1
Model Auto
OS win32 (x64)
Terminal windows-terminal
Shell cmd

Additional Information

Hook file example:

{
“version”: 1,
“hooks”: {
“subagentStop”: [
{
“command”: “C:\Users\tyler\AppData\Local\Python\pythoncore-3.14-64\python.exe C:\tmp\prompt_submit_logger.py cursor”,
“timeout”: 5
}
],
“preToolUse”: [
{
“command”: “C:\Users\tyler\AppData\Local\Python\pythoncore-3.14-64\python.exe C:\tmp\prompt_submit_logger.py cursor”,
“timeout”: 5
}
],
“afterTabFileEdit”: [
{
“command”: “C:\Users\tyler\AppData\Local\Python\pythoncore-3.14-64\python.exe C:\tmp\prompt_submit_logger.py cursor”,
“timeout”: 5
}
],
}
}

Hook log:

{“conversation_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“generation_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“model”:“default”,“is_background_agent”:false,“session_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“hook_event_name”:“sessionStart”,“cursor_version”:“2026.04.08-a41fba1”,“workspace_roots”:[“C:\Users\tyler”],“transcript_path”:null,“_agent_type”:“cursor”,“_pid”:8304,“_ppid”:11832,“_logged_at”:“2026-04-09T14:08:25.993941+00:00”}
{“conversation_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“generation_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“model”:“default”,“is_background_agent”:false,“session_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“hook_event_name”:“sessionStart”,“cursor_version”:“2026.04.08-a41fba1”,“workspace_roots”:[“C:\Users\tyler”],“transcript_path”:null,“_agent_type”:“cursor”,“_pid”:2460,“_ppid”:8104,“_logged_at”:“2026-04-09T14:08:25.995880+00:00”}
{“conversation_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“generation_id”:“8e2b18ab-16e4-4abe-9bc7-6c2370dce25b”,“model”:“default”,“prompt”:“test123”,“attachments”:,“session_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“hook_event_name”:“beforeSubmitPrompt”,“cursor_version”:“2026.04.08-a41fba1”,“workspace_roots”:[“C:\Users\tyler”],“transcript_path”:null,“_agent_type”:“cursor”,“_pid”:5224,“_ppid”:12156,“_logged_at”:“2026-04-09T14:08:28.943456+00:00”}
{“conversation_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“generation_id”:“8e2b18ab-16e4-4abe-9bc7-6c2370dce25b”,“model”:“default”,“prompt”:“test123”,“attachments”:,“session_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“hook_event_name”:“beforeSubmitPrompt”,“cursor_version”:“2026.04.08-a41fba1”,“workspace_roots”:[“C:\Users\tyler”],“transcript_path”:null,“_agent_type”:“cursor”,“_pid”:5108,“_ppid”:3024,“_logged_at”:“2026-04-09T14:08:28.946193+00:00”}
{“conversation_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“generation_id”:“8e2b18ab-16e4-4abe-9bc7-6c2370dce25b”,“model”:“default”,“status”:“completed”,“loop_count”:0,“input_tokens”:10129,“output_tokens”:34,“cache_read_tokens”:4608,“cache_write_tokens”:0,“session_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“hook_event_name”:“stop”,“cursor_version”:“2026.04.08-a41fba1”,“workspace_roots”:[“C:\Users\tyler”],“transcript_path”:“C:\Users\tyler\.cursor\projects\C-Users-tyler\agent-transcripts\b1fb9e60-929d-4eb5-8d00-379cecd1f5db\b1fb9e60-929d-4eb5-8d00-379cecd1f5db.jsonl”,“_agent_type”:“cursor”,“_pid”:4688,“_ppid”:9916,“_logged_at”:“2026-04-09T14:08:37.166252+00:00”}
{“conversation_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“generation_id”:“8e2b18ab-16e4-4abe-9bc7-6c2370dce25b”,“model”:“default”,“status”:“completed”,“loop_count”:0,“input_tokens”:10129,“output_tokens”:34,“cache_read_tokens”:4608,“cache_write_tokens”:0,“session_id”:“b1fb9e60-929d-4eb5-8d00-379cecd1f5db”,“hook_event_name”:“stop”,“cursor_version”:“2026.04.08-a41fba1”,“workspace_roots”:[“C:\Users\tyler”],“transcript_path”:“C:\Users\tyler\.cursor\projects\C-Users-tyler\agent-transcripts\b1fb9e60-929d-4eb5-8d00-379cecd1f5db\b1fb9e60-929d-4eb5-8d00-379cecd1f5db.jsonl”,“_agent_type”:“cursor”,“_pid”:1728,“_ppid”:12164,“_logged_at”:“2026-04-09T14:08:37.217218+00:00”}

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report, the log details are great.

This is a confirmed bug. When the CLI is run from the home directory C:\Users\tyler, the system loads ~/.cursor/hooks.json twice, once as user config and once as project config. This happens because the project path falls back to the home directory when .git isn’t found. There’s no deduping between these two sources, so hooks fire twice.

I’ve shared this with the team. There’s no timeline for a fix yet, but your report helps with prioritization.

Workaround: run the CLI from your project directory where .git exists, not from the home directory. Then projectConfigPath will point somewhere else and there won’t be a conflict. Another option is to create a project-level .cursor/hooks.json in your working directory and remove the hooks from the user-level config.

Let me know if the workaround helps.

Thanks!

Just tried and yes it works as expected when not in home directory, even without a .git folder present.

1 Like