π Pre-flight Checks
π Bug Description
On Windows, none of the Claude Code plugin hooks actually execute. Every hook in plugin/claude-code/hooks/hooks.json invokes its .sh script directly:
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/session-start.sh\""
Windows cannot execute .sh files, so ShellExecute opens them with the file-associated editor instead of running them. This affects all five hooks (SessionStart, post-compaction, UserPromptSubmit, SubagentStop, Stop), so the memory features that depend on hooks (session tracking, auto-import, compaction recovery, passive capture) silently never run.
Environment: Windows 11 Pro Β· Claude Code 2.1.206 Β· engram v1.19.0 Β· plugin 0.1.1 Β· installed via the official engram setup claude-code Β· Git Bash on PATH (C:\Program Files\Git\usr\bin\bash.exe).
Fix that works locally: prefixing every hook command with bash makes all five hooks work (verified: session-start.sh returns the memory protocol + context payload with exit 0):
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/session-start.sh\""
Git Bash wins PATH resolution over the WSL stub on a standard Git-for-Windows install, and Claude Code already requires Git Bash on Windows, so bash should be a safe cross-platform prefix (no-op on macOS/Linux).
Side note: scripts/user-prompt-submit.ps1 ships in the plugin but is never referenced by hooks.json β looks like a Windows path was started but not wired up. Happy to test a fix on Windows.
π Steps to Reproduce
- On Windows 11, install the plugin with
engram setup claude-code.
- Start any Claude Code session (or submit a prompt, or let a session stop).
- Watch the editor associated with
.sh files open instead of the hook executing.
β
Expected Behavior
Hook scripts execute silently: SessionStart injects the memory protocol and prior context, UserPromptSubmit/SubagentStop/Stop capture session data into engram. No windows open.
β Actual Behavior
The .sh file-associated editor (VS Code in my case) opens showing ~/.claude/plugins/cache/engram/engram/0.1.1/scripts and closes shortly after β on every SessionStart, UserPromptSubmit, SubagentStop and Stop. The hooks never actually run, so no session tracking, context injection or compaction recovery happens on Windows.
Operating System
Windows
Engram Version
1.19.0
Agent / Client
Claude Code
π Relevant Logs
π‘ Additional Context
No response
π Pre-flight Checks
status:approvedbefore a PR can be openedπ Bug Description
On Windows, none of the Claude Code plugin hooks actually execute. Every hook in
plugin/claude-code/hooks/hooks.jsoninvokes its.shscript directly:Windows cannot execute
.shfiles, so ShellExecute opens them with the file-associated editor instead of running them. This affects all five hooks (SessionStart, post-compaction, UserPromptSubmit, SubagentStop, Stop), so the memory features that depend on hooks (session tracking, auto-import, compaction recovery, passive capture) silently never run.Environment: Windows 11 Pro Β· Claude Code 2.1.206 Β· engram v1.19.0 Β· plugin 0.1.1 Β· installed via the official
engram setup claude-codeΒ· Git Bash on PATH (C:\Program Files\Git\usr\bin\bash.exe).Fix that works locally: prefixing every hook command with
bashmakes all five hooks work (verified:session-start.shreturns the memory protocol + context payload with exit 0):Git Bash wins PATH resolution over the WSL stub on a standard Git-for-Windows install, and Claude Code already requires Git Bash on Windows, so
bashshould be a safe cross-platform prefix (no-op on macOS/Linux).Side note:
scripts/user-prompt-submit.ps1ships in the plugin but is never referenced byhooks.jsonβ looks like a Windows path was started but not wired up. Happy to test a fix on Windows.π Steps to Reproduce
engram setup claude-code..shfiles open instead of the hook executing.β Expected Behavior
Hook scripts execute silently: SessionStart injects the memory protocol and prior context, UserPromptSubmit/SubagentStop/Stop capture session data into engram. No windows open.
β Actual Behavior
The
.shfile-associated editor (VS Code in my case) opens showing~/.claude/plugins/cache/engram/engram/0.1.1/scriptsand closes shortly after β on every SessionStart, UserPromptSubmit, SubagentStop and Stop. The hooks never actually run, so no session tracking, context injection or compaction recovery happens on Windows.Operating System
Windows
Engram Version
1.19.0
Agent / Client
Claude Code
π Relevant Logs
π‘ Additional Context
No response