[BUG] UserPromptSubmit hook not working

Resolved 💬 5 comments Opened Sep 19, 2025 by Windows11CE Closed Jan 6, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Given this setup:

{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "bun $CLAUDE_PROJECT_DIR/.claude/hooks/add-default-prompt-context.mjs" 
          }
        ]
      }
    ]
  }
}

And this script:

console.log("The word of the day is: CANELA");

The model does not seem to be loading the hook's stdout in it's context. As seen here:

<img width="743" height="339" alt="Image" src="https://github.com/user-attachments/assets/034f595e-96ee-45c5-a793-2235a780f525" />

I have already gone through my /hooks to make sure it is in there:

<img width="724" height="279" alt="Image" src="https://github.com/user-attachments/assets/0779bb87-3d70-48ee-bfeb-069ceb03dcaf" />

And here is the script working properly on my shell:

# bun .\.claude\hooks\add-default-prompt-context.mjs
The word of the day is: CANELA

What Should Happen?

I expect the context to be properly loaded

Error Messages/Logs

There are no error messages or logs

Steps to Reproduce

You should be able to replicate by the description provided above

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

1.0.119

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗