[GH-ISSUE #604] windows+cursor hooks: Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1 #194

Closed
opened 2026-03-02 04:12:46 +03:00 by kerem · 9 comments
Owner

Originally created by @RobotAR14 on GitHub (Feb 27, 2026).
Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/604

Image

system: win11
agent: cursor
hooks.json:
{
"hooks": {
"afterFileEdit": [
{
"command": "\\?\C:\Users\46996\.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin"
}
],
"beforeSubmitPrompt": [
{
"command": "\\?\C:\Users\46996\.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin"
}
]
},
"version": 1
}

Originally created by @RobotAR14 on GitHub (Feb 27, 2026). Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/604 <img width="872" height="534" alt="Image" src="https://github.com/user-attachments/assets/776b178d-3054-497c-a800-4b225a4ac8e6" /> system: win11 agent: cursor hooks.json: { "hooks": { "afterFileEdit": [ { "command": "\\\\?\\C:\\Users\\46996\\.git-ai\\bin\\git-ai.exe checkpoint cursor --hook-input stdin" } ], "beforeSubmitPrompt": [ { "command": "\\\\?\\C:\\Users\\46996\\.git-ai\\bin\\git-ai.exe checkpoint cursor --hook-input stdin" } ] }, "version": 1 }
kerem closed this issue 2026-03-02 04:12:46 +03:00
Author
Owner

@svarlamov commented on GitHub (Feb 27, 2026):

This should be fixed as of 1.1.5 -- can you try if this is fixed after git-ai upgrade?

<!-- gh-comment-id:3973432281 --> @svarlamov commented on GitHub (Feb 27, 2026): This should be fixed as of `1.1.5` -- can you try if this is fixed after `git-ai upgrade`?
Author
Owner

@RobotAR14 commented on GitHub (Feb 28, 2026):

This should be fixed as of 1.1.5 -- can you try if this is fixed after git-ai upgrade?
upgrade to 1.1.6, not yet! here is hooks log:

[2026-02-28T03:36:20.970Z] Initializing Cursor Hooks Service...
[2026-02-28T03:36:20.970Z] Claude user config path: c:\Users\46996.claude\settings.json
[2026-02-28T03:36:20.970Z] Project config path: d:\code\work\front\new_demo.cursor\hooks.json
[2026-02-28T03:36:20.970Z] Claude project config path: d:\code\work\front\new_demo.claude\settings.json
[2026-02-28T03:36:20.970Z] Claude project local config path: d:\code\work\front\new_demo.claude\settings.local.json
[2026-02-28T03:36:20.970Z] User config path: c:\Users\46996.cursor\hooks.json
[2026-02-28T03:36:20.970Z] Enterprise config path: file:///c%3A/ProgramData/Cursor/hooks.json
[2026-02-28T03:36:20.971Z] Reloading hooks configuration...
[2026-02-28T03:36:21.078Z] Loaded Claude user hooks
[2026-02-28T03:36:23.045Z] Reloading hooks configuration...
[2026-02-28T03:36:23.099Z] Loaded Claude user hooks
[2026-02-28T03:36:25.372Z] No enterprise hooks configuration found
[2026-02-28T03:36:25.372Z] No enterprise hooks configuration found
[2026-02-28T03:36:25.378Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt
[2026-02-28T03:36:25.378Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt
[2026-02-28T03:36:25.381Z] No project hooks configuration found
[2026-02-28T03:36:25.383Z] Refreshing team hooks...
[2026-02-28T03:36:25.383Z] Cursor Hooks Service initialized successfully
[2026-02-28T03:36:25.387Z] No project hooks configuration found
[2026-02-28T03:36:26.698Z] Reloading hooks configuration...
[2026-02-28T03:36:26.745Z] Loaded Claude user hooks
[2026-02-28T03:36:27.656Z] No enterprise hooks configuration found
[2026-02-28T03:36:27.658Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt
[2026-02-28T03:36:27.660Z] No project hooks configuration found
[2026-02-28T03:38:26.298Z] Reloading hooks configuration...
[2026-02-28T03:38:26.303Z] Loaded Claude user hooks
[2026-02-28T03:38:27.123Z] No enterprise hooks configuration found
[2026-02-28T03:38:27.125Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt
[2026-02-28T03:38:27.127Z] No project hooks configuration found
[2026-02-28T03:38:47.264Z] Reloading hooks configuration...
[2026-02-28T03:38:47.266Z] Loaded Claude user hooks
[2026-02-28T03:38:48.058Z] No enterprise hooks configuration found
[2026-02-28T03:38:48.063Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt
[2026-02-28T03:38:48.064Z] No project hooks configuration found
[2026-02-28T03:38:51.190Z] Hook step requested: beforeSubmitPrompt
[2026-02-28T03:38:51.194Z] Found 1 hook(s) to execute for step: beforeSubmitPrompt
[2026-02-28T03:38:51.194Z] Executing hook 1/1 from user config
[2026-02-28T03:38:51.194Z] Running script in directory: c:\Users\46996.cursor
[2026-02-28T03:38:51.201Z] Running hook 1 with timeout 60000ms
═══════════════════════════════════════════════════════════════════════════════════════
beforeSubmitPrompt
═══════════════════════════════════════════════════════════════════════════════════════
Command: C:\Users\46996.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin (906ms) exit code: 0

INPUT:
{
"conversation_id": "75014a8a-0365-486e-9be2-9073ef46dac7",
"generation_id": "3939fa43-db99-4de3-9c50-f8668631b702",
"model": "default",
"prompt": "print sss",
"attachments": [
{
"type": "file",
"file_path": "d:\code\work\front\new_demo\util.js"
}
],
"hook_event_name": "beforeSubmitPrompt",
"cursor_version": "2.5.26",
"workspace_roots": [
"/d:/code/work/front/new_demo"
],
"user_email": "lzflzf30@gmail.com",
"transcript_path": null
}

OUTPUT:
(empty)

STDERR:
Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1

═══════════════════════════════════════════════════════════════════════════════════════
[2026-02-28T03:38:52.100Z] Hook 1 produced no output
[2026-02-28T03:38:52.100Z] All hooks for step beforeSubmitPrompt completed but none returned a valid response
[2026-02-28T03:38:53.975Z] Hook step requested: afterFileEdit
[2026-02-28T03:38:54.059Z] Found 1 hook(s) to execute for step: afterFileEdit
[2026-02-28T03:38:54.059Z] Executing hook 1/1 from user config
[2026-02-28T03:38:54.059Z] Running script in directory: c:\Users\46996.cursor
[2026-02-28T03:38:54.069Z] Running hook 1 with timeout 60000ms
═══════════════════════════════════════════════════════════════════════════════════════
afterFileEdit
═══════════════════════════════════════════════════════════════════════════════════════
Command: C:\Users\46996.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin (889ms) exit code: 0

INPUT:
{
"conversation_id": "75014a8a-0365-486e-9be2-9073ef46dac7",
"generation_id": "3939fa43-db99-4de3-9c50-f8668631b702",
"model": "default",
"file_path": "d:\code\work\front\new_demo\util.js",
"edits": [
{
"old_string": "",
"new_string": "console.log('sss');"
}
],
"hook_event_name": "afterFileEdit",
"cursor_version": "2.5.26",
"workspace_roots": [
"/d:/code/work/front/new_demo"
],
"user_email": "lzflzf30@gmail.com",
"transcript_path": null
}

OUTPUT:
(empty)

STDERR:
Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1

═══════════════════════════════════════════════════════════════════════════════════════
[2026-02-28T03:38:54.948Z] Hook 1 produced no output
[2026-02-28T03:38:54.948Z] All hooks for step afterFileEdit completed but none returned a valid response
[2026-02-28T03:39:17.253Z] Reloading hooks configuration...
[2026-02-28T03:39:17.256Z] Loaded Claude user hooks
[2026-02-28T03:39:18.062Z] No enterprise hooks configuration found
[2026-02-28T03:39:18.065Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt
[2026-02-28T03:39:18.065Z] No project hooks configuration found
[2026-02-28T03:39:38.371Z] Reloading hooks configuration...
[2026-02-28T03:39:38.373Z] Loaded Claude user hooks
[2026-02-28T03:39:39.418Z] No enterprise hooks configuration found
[2026-02-28T03:39:39.420Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt
[2026-02-28T03:39:39.421Z] No project hooks configuration found

<!-- gh-comment-id:3976262446 --> @RobotAR14 commented on GitHub (Feb 28, 2026): > This should be fixed as of `1.1.5` -- can you try if this is fixed after `git-ai upgrade`? upgrade to 1.1.6, not yet! here is hooks log: [2026-02-28T03:36:20.970Z] Initializing Cursor Hooks Service... [2026-02-28T03:36:20.970Z] Claude user config path: c:\Users\46996\.claude\settings.json [2026-02-28T03:36:20.970Z] Project config path: d:\code\work\front\new_demo\.cursor\hooks.json [2026-02-28T03:36:20.970Z] Claude project config path: d:\code\work\front\new_demo\.claude\settings.json [2026-02-28T03:36:20.970Z] Claude project local config path: d:\code\work\front\new_demo\.claude\settings.local.json [2026-02-28T03:36:20.970Z] User config path: c:\Users\46996\.cursor\hooks.json [2026-02-28T03:36:20.970Z] Enterprise config path: file:///c%3A/ProgramData/Cursor/hooks.json [2026-02-28T03:36:20.971Z] Reloading hooks configuration... [2026-02-28T03:36:21.078Z] Loaded Claude user hooks [2026-02-28T03:36:23.045Z] Reloading hooks configuration... [2026-02-28T03:36:23.099Z] Loaded Claude user hooks [2026-02-28T03:36:25.372Z] No enterprise hooks configuration found [2026-02-28T03:36:25.372Z] No enterprise hooks configuration found [2026-02-28T03:36:25.378Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt [2026-02-28T03:36:25.378Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt [2026-02-28T03:36:25.381Z] No project hooks configuration found [2026-02-28T03:36:25.383Z] Refreshing team hooks... [2026-02-28T03:36:25.383Z] Cursor Hooks Service initialized successfully [2026-02-28T03:36:25.387Z] No project hooks configuration found [2026-02-28T03:36:26.698Z] Reloading hooks configuration... [2026-02-28T03:36:26.745Z] Loaded Claude user hooks [2026-02-28T03:36:27.656Z] No enterprise hooks configuration found [2026-02-28T03:36:27.658Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt [2026-02-28T03:36:27.660Z] No project hooks configuration found [2026-02-28T03:38:26.298Z] Reloading hooks configuration... [2026-02-28T03:38:26.303Z] Loaded Claude user hooks [2026-02-28T03:38:27.123Z] No enterprise hooks configuration found [2026-02-28T03:38:27.125Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt [2026-02-28T03:38:27.127Z] No project hooks configuration found [2026-02-28T03:38:47.264Z] Reloading hooks configuration... [2026-02-28T03:38:47.266Z] Loaded Claude user hooks [2026-02-28T03:38:48.058Z] No enterprise hooks configuration found [2026-02-28T03:38:48.063Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt [2026-02-28T03:38:48.064Z] No project hooks configuration found [2026-02-28T03:38:51.190Z] Hook step requested: beforeSubmitPrompt [2026-02-28T03:38:51.194Z] Found 1 hook(s) to execute for step: beforeSubmitPrompt [2026-02-28T03:38:51.194Z] Executing hook 1/1 from user config [2026-02-28T03:38:51.194Z] Running script in directory: c:\Users\46996\.cursor [2026-02-28T03:38:51.201Z] Running hook 1 with timeout 60000ms ═══════════════════════════════════════════════════════════════════════════════════════ beforeSubmitPrompt ═══════════════════════════════════════════════════════════════════════════════════════ Command: C:\Users\46996\.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin (906ms) exit code: 0 INPUT: { "conversation_id": "75014a8a-0365-486e-9be2-9073ef46dac7", "generation_id": "3939fa43-db99-4de3-9c50-f8668631b702", "model": "default", "prompt": "print sss", "attachments": [ { "type": "file", "file_path": "d:\\code\\work\\front\\new_demo\\util.js" } ], "hook_event_name": "beforeSubmitPrompt", "cursor_version": "2.5.26", "workspace_roots": [ "/d:/code/work/front/new_demo" ], "user_email": "lzflzf30@gmail.com", "transcript_path": null } OUTPUT: (empty) STDERR: Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1 ═══════════════════════════════════════════════════════════════════════════════════════ [2026-02-28T03:38:52.100Z] Hook 1 produced no output [2026-02-28T03:38:52.100Z] All hooks for step beforeSubmitPrompt completed but none returned a valid response [2026-02-28T03:38:53.975Z] Hook step requested: afterFileEdit [2026-02-28T03:38:54.059Z] Found 1 hook(s) to execute for step: afterFileEdit [2026-02-28T03:38:54.059Z] Executing hook 1/1 from user config [2026-02-28T03:38:54.059Z] Running script in directory: c:\Users\46996\.cursor [2026-02-28T03:38:54.069Z] Running hook 1 with timeout 60000ms ═══════════════════════════════════════════════════════════════════════════════════════ afterFileEdit ═══════════════════════════════════════════════════════════════════════════════════════ Command: C:\Users\46996\.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin (889ms) exit code: 0 INPUT: { "conversation_id": "75014a8a-0365-486e-9be2-9073ef46dac7", "generation_id": "3939fa43-db99-4de3-9c50-f8668631b702", "model": "default", "file_path": "d:\\code\\work\\front\\new_demo\\util.js", "edits": [ { "old_string": "", "new_string": "console.log('sss');" } ], "hook_event_name": "afterFileEdit", "cursor_version": "2.5.26", "workspace_roots": [ "/d:/code/work/front/new_demo" ], "user_email": "lzflzf30@gmail.com", "transcript_path": null } OUTPUT: (empty) STDERR: Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1 ═══════════════════════════════════════════════════════════════════════════════════════ [2026-02-28T03:38:54.948Z] Hook 1 produced no output [2026-02-28T03:38:54.948Z] All hooks for step afterFileEdit completed but none returned a valid response [2026-02-28T03:39:17.253Z] Reloading hooks configuration... [2026-02-28T03:39:17.256Z] Loaded Claude user hooks [2026-02-28T03:39:18.062Z] No enterprise hooks configuration found [2026-02-28T03:39:18.065Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt [2026-02-28T03:39:18.065Z] No project hooks configuration found [2026-02-28T03:39:38.371Z] Reloading hooks configuration... [2026-02-28T03:39:38.373Z] Loaded Claude user hooks [2026-02-28T03:39:39.418Z] No enterprise hooks configuration found [2026-02-28T03:39:39.420Z] Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPrompt [2026-02-28T03:39:39.421Z] No project hooks configuration found
Author
Owner

@RobotAR14 commented on GitHub (Feb 28, 2026):

Image
<!-- gh-comment-id:3976263779 --> @RobotAR14 commented on GitHub (Feb 28, 2026): <img width="678" height="138" alt="Image" src="https://github.com/user-attachments/assets/5f95d0f0-8349-4115-bcca-d0b996cef43d" />
Author
Owner

@svarlamov commented on GitHub (Feb 28, 2026):

I believe this error is from Cursor trying to parse JSON output (which git-ai doesn't output)

Command: C:\Users\46996.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin (889ms) exit code: 0

This part and the exit code 0 seems like it works. Can you double check that things look right if you git commit?

Edit: Nvm, I double checked and this bit Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1 is actually from git-ai. What version of Cursor are you on?

<!-- gh-comment-id:3976271203 --> @svarlamov commented on GitHub (Feb 28, 2026): I believe this error is from Cursor trying to parse JSON output (which git-ai doesn't output) ``` Command: C:\Users\46996.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin (889ms) exit code: 0 ``` This part and the exit code 0 seems like it works. Can you double check that things look right if you git commit? Edit: Nvm, I double checked and this bit `Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1` is actually from git-ai. What version of Cursor are you on?
Author
Owner

@svarlamov commented on GitHub (Feb 28, 2026):

Can you try installing this pre-release build: https://github.com/git-ai-project/git-ai/releases/tag/v1.1.7-next-7130b7a

should be fixed now

<!-- gh-comment-id:3976431998 --> @svarlamov commented on GitHub (Feb 28, 2026): Can you try installing this pre-release build: https://github.com/git-ai-project/git-ai/releases/tag/v1.1.7-next-7130b7a should be fixed now
Author
Owner

@RobotAR14 commented on GitHub (Feb 28, 2026):

I believe this error is from Cursor trying to parse JSON output (which git-ai doesn't output)

Command: C:\Users\46996.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin (889ms) exit code: 0

This part and the exit code 0 seems like it works. Can you double check that things look right if you git commit?

Edit: Nvm, I double checked and this bit Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1 is actually from git-ai. What version of Cursor are you on?

cursor version:

Image

use git-ai status --json, AI code always 0

<!-- gh-comment-id:3976462243 --> @RobotAR14 commented on GitHub (Feb 28, 2026): > I believe this error is from Cursor trying to parse JSON output (which git-ai doesn't output) > > ``` > Command: C:\Users\46996.git-ai\bin\git-ai.exe checkpoint cursor --hook-input stdin (889ms) exit code: 0 > ``` > > This part and the exit code 0 seems like it works. Can you double check that things look right if you git commit? > > Edit: Nvm, I double checked and this bit `Error running Cursor preset: Invalid JSON in hook_input: expected value at line 1 column 1` is actually from git-ai. What version of Cursor are you on? cursor version: <img width="390" height="324" alt="Image" src="https://github.com/user-attachments/assets/d6354aff-50cc-426b-bc75-7c546f3870b9" /> use git-ai status --json, AI code always 0
Author
Owner

@RobotAR14 commented on GitHub (Feb 28, 2026):

Can you try installing this pre-release build: https://github.com/git-ai-project/git-ai/releases/tag/v1.1.7-next-7130b7a

should be fixed now

not yet! installed this pre-release, but version is same as last

Image
<!-- gh-comment-id:3976465487 --> @RobotAR14 commented on GitHub (Feb 28, 2026): > Can you try installing this pre-release build: https://github.com/git-ai-project/git-ai/releases/tag/v1.1.7-next-7130b7a > > should be fixed now not yet! installed this pre-release, but version is same as last <img width="1306" height="520" alt="Image" src="https://github.com/user-attachments/assets/5b34e3be-b770-4dc9-8dbd-83e6a8515215" />
Author
Owner

@svarlamov commented on GitHub (Feb 28, 2026):

Try running git-ai upgrade should be fixed in the latest production release 😄

<!-- gh-comment-id:3977575237 --> @svarlamov commented on GitHub (Feb 28, 2026): Try running `git-ai upgrade` should be fixed in the latest production release 😄
Author
Owner

@RobotAR14 commented on GitHub (Mar 1, 2026):

Try running git-ai upgrade should be fixed in the latest production release 😄

yeah,it's fixed after upgrade to 1.1.7, thank you very much!

<!-- gh-comment-id:3978903839 --> @RobotAR14 commented on GitHub (Mar 1, 2026): > Try running `git-ai upgrade` should be fixed in the latest production release 😄 yeah,it's fixed after upgrade to 1.1.7, thank you very much!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#194
No description provided.