Official learning-output-style plugin SessionStart hook fails on Windows
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?
The official learning-output-style@claude-plugins-official plugin fails to execute its SessionStart hook on Windows.
Instead of executing the hook script, Claude Code opens the .sh file in the user's IDE when launching. The plugin appears enabled in settings and Claude Code reports hook success, but the hook output is never passed to Claude's system context.
What Should Happen?
When Claude Code starts a new conversation, the SessionStart hook should execute session-start.sh, which outputs JSON with learning mode instructions. Claude should receive this output as additionalContext in the system prompt.
Error Messages/Logs
No explicit errors. When checking hook execution, Claude Code reports: SessionStart:Callback hook success: Success
<img width="750" height="162" alt="Image" src="https://github.com/user-attachments/assets/615e10f7-647c-4b2d-bdcf-97c8963a589a" />
Steps to Reproduce
Environment:
- OS: Windows 10/11 (Git Bash environment)
- Claude Code version: 2.0.75 (npm install)
- Plugin: learning-output-style@claude-plugins-official (version ab2b6d0cad88), installed locally for user scope.
Steps:
- Install the plugin "learning-output-style" from claude-plugins-official marketplac
- Enable the plugin in settings.
- Restart Claude Code
- Start a new conversation
- Observed behaviour: The file ~/.claude/plugins/cache/claude-plugins-official/learning-output-style/ab2b6d0cad88/hooks-handlers/session-start.sh opens in your IDE
- Expected behaviour: The script should execute and Claude should receive learning mode instructions in its system context
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.75
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Root Cause:
The hook configuration in hooks/hooks.json:
{
"description": "Learning mode hook that adds interactive learning instructions",
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh"
}
]
}
]
}
}
.sh files aren't executable without explicitly invoking bash, not sure if this is a windows issue or in general with CC.
But the command is treated as a file path rather than an executable.
Workaround:
Manually edit hooks/hooks.json to prefix the command with bash:
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh"
After this change and restarting Claude Code, the hook executes correctly and claude receives the hook correctly.
Suggested Fix:
Update the official plugin's hooks.json to use the bash prefix:
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh"
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗