-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Bug: omc update does not copy hooks/lib/ directory, causing ERR_MODULE_NOT_FOUND #2185
Copy link
Copy link
Open
Labels
agentsRelated to agent definitionsRelated to agent definitionsbugSomething isn't workingSomething isn't working
Description
Description
After running omc update (4.9.3 → 4.10.2), all .mjs hook files fail with:
node:internal/modules/esm/resolve:275
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/<user>/.claude/hooks/lib/stdin.mjs'
imported from /Users/<user>/.claude/hooks/persistent-mode.mjs
Root Cause
The update process copies .mjs hook files to ~/.claude/hooks/ but does not copy the lib/ subdirectory (stdin.mjs, atomic-write.mjs) from templates/hooks/lib/.
The files exist in the plugin cache at:
~/.claude/plugins/cache/omc/oh-my-claudecode/4.10.2/templates/hooks/lib/
├── atomic-write.mjs
└── stdin.mjs
But ~/.claude/hooks/lib/ is never created during the update.
Affected Hooks
All .mjs hooks that import from ./lib/stdin.mjs:
persistent-mode.mjskeyword-detector.mjspre-tool-use.mjspost-tool-use.mjscode-simplifier.mjssession-start.mjs
Steps to Reproduce
- Have OMC installed via npm (e.g., v4.9.3)
- Run
omc update - Observe
ERR_MODULE_NOT_FOUNDon every Stop/PreToolUse/PostToolUse hook
Workaround
mkdir -p ~/.claude/hooks/lib
cp ~/.claude/plugins/cache/omc/oh-my-claudecode/4.10.2/templates/hooks/lib/*.mjs ~/.claude/hooks/lib/Expected Behavior
omc update (and the installer) should copy templates/hooks/lib/ alongside the .mjs hook files.
Environment
- OS: macOS (Darwin 24.5.0)
- Node: 22+
- Install method: npm
- OMC version: 4.10.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agentsRelated to agent definitionsRelated to agent definitionsbugSomething isn't workingSomething isn't working