move hooks to .claude-plugin/hooks/hooks.json (canonical location)

Per Claude Code's plugin spec at https://code.claude.com/docs/en/plugins.md,
hooks must live at `.claude-plugin/hooks/hooks.json` — a `hooks/`
subdirectory inside `.claude-plugin/`. v1.0.0 had `hooks.json`
directly under `.claude-plugin/` (loaded 0 hooks); v1.0.1 inlined
into `plugin.json` (also not supported). v1.0.2 puts the file at
the documented path.

Schema is unchanged — three-level nesting (event → matcher list →
handler list), same as user settings.json. `${CLAUDE_PLUGIN_ROOT}`
substitution is supported here.
This commit is contained in:
Oleks
2026-05-10 22:03:15 +03:00
parent 1d52542d28
commit daf1f1169f
2 changed files with 66 additions and 64 deletions
+64
View File
@@ -0,0 +1,64 @@
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh UserPromptSubmit"
}
]
}
],
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh PreToolUse"
}
]
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh PostToolUse"
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh Notification"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh Stop"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh SessionEnd"
}
]
}
]
}
}
+2 -64
View File
@@ -1,6 +1,6 @@
{
"name": "hyprpanel-state",
"version": "1.0.1",
"version": "1.0.2",
"description": "Surfaces per-window Claude Code state in the Hyprland workspaces bar (HyprPanel). Wires hooks for UserPromptSubmit / PreToolUse / PostToolUse / Notification / Stop / SessionEnd that write state tokens to /tmp/hyprpanel-claude/<addr> for the bar to read. Each kitty's icon and pip indicator reflects whether claude is active (blue), waiting on input (orange ●), done (green ✔), or sleeping for a /loop ScheduleWakeup (cyan ⧗). Companion to the workspaces patch in projects/hyprpanel-dev — installed bar binary needs that patch for the visuals; this plugin only owns the hook side.",
"author": {
"name": "oleks",
@@ -15,67 +15,5 @@
"claude-state",
"desktop-integration",
"linux"
],
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh UserPromptSubmit"
}
]
}
],
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh PreToolUse"
}
]
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh PostToolUse"
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh Notification"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh Stop"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/hyprpanel-state.sh SessionEnd"
}
]
}
]
}
]
}