Bug: Hook-Pfade werden falsch expandiert (${CLAUDE_PLUGIN_ROOT} → /plugin/scripts/) #231

Closed
opened 2026-01-24 20:52:59 +00:00 by jack · 0 comments
Owner

Problem

Die hooks/hooks.json im Plugin verwendet korrekt die Variable ${CLAUDE_PLUGIN_ROOT}:

{
  "command": "bun \"${CLAUDE_PLUGIN_ROOT}/scripts/worker-service.cjs\" start"
}

Wenn diese Hooks in die Haupt-hooks.json (z.B. ~/.config/claude-lab/hooks.json) kompiliert werden, wird der Pfad falsch expandiert:

{
  "command": "bun \"/home/jonas/.config/claude-lab/plugins/marketplaces/customable/plugin/scripts/worker-service.cjs\" start"
}

Das /plugin/ Verzeichnis existiert aber nicht. Der korrekte Pfad wäre:

/home/jonas/.config/claude-lab/plugins/marketplaces/customable/scripts/worker-service.cjs

Auswirkung

  • Alle Hooks schlagen fehl mit error: Module not found
  • Keine Sessions/Observations werden erstellt
  • Das Plugin funktioniert effektiv nicht

Betroffene Umgebungen

  • ~/.config/claude-lab/hooks.json - fehlerhaft
  • ~/.config/claude-work/hooks.json - fehlerhaft (gleicher Bug)

Workaround

Manuell in der Haupt-hooks.json /plugin/scripts/ durch /scripts/ ersetzen.

Ursache

Vermutlich wird bei der Hook-Kompilierung ${CLAUDE_PLUGIN_ROOT} zu <path>/plugin expandiert (anstatt nur <path>), was auf eine alte Verzeichnisstruktur hindeutet wo das Plugin in einem plugin/ Unterordner lag.

## Problem Die `hooks/hooks.json` im Plugin verwendet korrekt die Variable `${CLAUDE_PLUGIN_ROOT}`: ```json { "command": "bun \"${CLAUDE_PLUGIN_ROOT}/scripts/worker-service.cjs\" start" } ``` Wenn diese Hooks in die Haupt-`hooks.json` (z.B. `~/.config/claude-lab/hooks.json`) kompiliert werden, wird der Pfad **falsch** expandiert: ```json { "command": "bun \"/home/jonas/.config/claude-lab/plugins/marketplaces/customable/plugin/scripts/worker-service.cjs\" start" } ``` Das `/plugin/` Verzeichnis existiert aber nicht. Der korrekte Pfad wäre: ``` /home/jonas/.config/claude-lab/plugins/marketplaces/customable/scripts/worker-service.cjs ``` ## Auswirkung - Alle Hooks schlagen fehl mit `error: Module not found` - Keine Sessions/Observations werden erstellt - Das Plugin funktioniert effektiv nicht ## Betroffene Umgebungen - `~/.config/claude-lab/hooks.json` - fehlerhaft - `~/.config/claude-work/hooks.json` - fehlerhaft (gleicher Bug) ## Workaround Manuell in der Haupt-hooks.json `/plugin/scripts/` durch `/scripts/` ersetzen. ## Ursache Vermutlich wird bei der Hook-Kompilierung `${CLAUDE_PLUGIN_ROOT}` zu `<path>/plugin` expandiert (anstatt nur `<path>`), was auf eine alte Verzeichnisstruktur hindeutet wo das Plugin in einem `plugin/` Unterordner lag.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
customable/claude-mem#231
No description provided.