Commit f8bcec1
fix: install SDK into CLAUDE_PLUGIN_ROOT for reliable ESM resolution
ESM import resolves packages relative to the importing file, not via
NODE_PATH. Previous approach (SDK in CLAUDE_PLUGIN_DATA with NODE_PATH)
failed because ESM ignores NODE_PATH.
New approach: SessionStart hook runs npm install in CLAUDE_PLUGIN_ROOT
itself, placing node_modules/ next to cli.mjs. ESM standard resolution
finds SDK naturally. Simpler bin wrapper, no NODE_PATH hacks.
Docs confirm CLAUDE_PLUGIN_ROOT is writable (but doesn't survive
plugin updates — SDK re-installs on update, which is fine).
Verified: LLM scan works (21 decisions, 8 from LLM, $0.39).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent b8e3a57 commit f8bcec1
1 file changed
Lines changed: 1 addition & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 71 | | |
81 | 72 | | |
82 | 73 | | |
| |||
105 | 96 | | |
106 | 97 | | |
107 | 98 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 99 | | |
112 | 100 | | |
113 | 101 | | |
| |||
119 | 107 | | |
120 | 108 | | |
121 | 109 | | |
122 | | - | |
| 110 | + | |
123 | 111 | | |
124 | 112 | | |
125 | 113 | | |
| |||
0 commit comments