claude-code - 💡(How to fix) Fix UserPromptSubmit hook does not fire on Windows platform [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52000Fetched 2026-04-23 07:39:14
View on GitHub
Comments
1
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×3closed ×1commented ×1

The UserPromptSubmit hook does not fire on Windows, even when CLAUDE_CODE_GIT_BASH_PATH is correctly configured. This is a platform-level bug that breaks all plugins depending on this hook.

Error Message

  • UserPromptSubmit hook error: failed with non-blocking status code: No stderr output

Root Cause

The UserPromptSubmit hook does not fire on Windows, even when CLAUDE_CODE_GIT_BASH_PATH is correctly configured. This is a platform-level bug that breaks all plugins depending on this hook.

Fix Action

Fix / Workaround

Both plugins failing simultaneously confirms that Claude Code itself is not dispatching UserPromptSubmit events to hook processes on Windows.

RAW_BUFFERClick to expand / collapse

$(cat <<'ENDOFFILE'

Description

The UserPromptSubmit hook does not fire on Windows, even when CLAUDE_CODE_GIT_BASH_PATH is correctly configured. This is a platform-level bug that breaks all plugins depending on this hook.

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Claude Code: 2.1.117
  • Git Bash: D:\Program Files\Git\bin\bash.exe
  • Model: qwen3.6-plus

Reproduction

  1. Set CLAUDE_CODE_GIT_BASH_PATH to a valid Git Bash path
  2. Install any plugin that registers a UserPromptSubmit hook (e.g. claude-mem or hookify)
  3. Send a message to Claude Code
  4. Observe: the UserPromptSubmit hook never fires

Observed Behavior

  • observations are never written to database (always 0 entries)
  • Logs show: Skipping observation - user prompt was entirely private {promptNumber=0}
  • UserPromptSubmit hook error: failed with non-blocking status code: No stderr output

Expected Behavior

The UserPromptSubmit hook should fire when the user submits a prompt, consistent with behavior on macOS/Linux.

Control Experiment

This is not a plugin-specific bug. Verified with two independent plugins:

  1. claude-mem — registered UserPromptSubmit hook, never fires
  2. hookify (Anthropic official plugin) — registered UserPromptSubmit hook with a rule matching all prompts, warning never appears after sending messages

Both plugins failing simultaneously confirms that Claude Code itself is not dispatching UserPromptSubmit events to hook processes on Windows.

Additional Findings

HookStatus on Windows
SessionStartWorks
PostToolUseWorks
UserPromptSubmitDoes not fire

CLAUDE_CODE_GIT_BASH_PATH is correctly set and other hooks work normally.

Impact

All plugins depending on UserPromptSubmit hook are unusable on Windows:

  • claude-mem: cannot record session observations
  • hookify: cannot process prompt rules
  • Any other plugin using this hook ENDOFFILE )

extent analysis

TL;DR

The UserPromptSubmit hook not firing on Windows can be addressed by investigating the platform-specific differences in how Claude Code dispatches events to hook processes.

Guidance

  • Verify that the CLAUDE_CODE_GIT_BASH_PATH environment variable is correctly set and accessible to the Claude Code process.
  • Compare the implementation of the UserPromptSubmit hook in Claude Code with other hooks like SessionStart and PostToolUse that are working on Windows to identify potential differences.
  • Test the UserPromptSubmit hook with a minimal plugin that only registers this hook to isolate the issue from other plugin-specific code.
  • Investigate the logging and error handling in Claude Code to understand why the UserPromptSubmit hook error is reported with a "non-blocking status code" and "No stderr output".

Example

No specific code example can be provided without more details on the Claude Code and plugin implementations.

Notes

The issue seems to be specific to the Windows platform, and the fact that other hooks are working suggests that the problem might be related to how the UserPromptSubmit hook is implemented or handled in Claude Code.

Recommendation

Apply a workaround by modifying the plugin to use an alternative hook or event that is known to work on Windows, if possible, until the root cause of the issue with the UserPromptSubmit hook is identified and fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING