Skip to content

Bug: omc update does not copy hooks/lib/ directory, causing ERR_MODULE_NOT_FOUND #2185

@simpsonkorea

Description

@simpsonkorea

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.mjs
  • keyword-detector.mjs
  • pre-tool-use.mjs
  • post-tool-use.mjs
  • code-simplifier.mjs
  • session-start.mjs

Steps to Reproduce

  1. Have OMC installed via npm (e.g., v4.9.3)
  2. Run omc update
  3. Observe ERR_MODULE_NOT_FOUND on 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentsRelated to agent definitionsbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions