Files
Oleks 302df34f09 initial: hyprpanel-state plugin
Hooks-only Claude Code plugin that surfaces per-window claude state
in the patched HyprPanel workspaces bar. Wires UserPromptSubmit /
PreToolUse / PostToolUse / Notification / Stop / SessionEnd to a
shell script that walks the parent-PID chain to find the kitty
client whose claude this script lives in, then writes a state token
to /tmp/hyprpanel-claude/<address>.

Bar visuals are owned separately by the workspaces patch in
projects/hyprpanel-dev. The contract between the two is the
/tmp/hyprpanel-claude/ directory layout (state file, .tools
counter, .ping sidecar for blink-decay animations).
2026-05-10 15:35:30 +03:00

49 lines
1.8 KiB
Markdown

# CLAUDE.md
Guidance for Claude Code when working in this repository.
## What This Is
A Claude Code plugin (no skill — this one is hooks-only) that bridges
Claude Code lifecycle events to a state file the HyprPanel workspaces bar
reads, so each kitty's icon reflects what claude is doing in that
terminal.
## Structure
```
.claude-plugin/plugin.json # Plugin manifest
.claude-plugin/hooks.json # Hook event → script mapping
hooks/hyprpanel-state.sh # The script: PPid walk + state file writes
README.md # User-facing docs
```
## Bar Side
This plugin does NOT own the visual — that lives in `~/projects/hyprpanel-dev`
(the patched HyprPanel). The contract between the two is the
`/tmp/hyprpanel-claude/` directory layout (state files, tools counter,
ping sidecar). Changes to the protocol must update both sides.
## Editing Guidelines
- Bump `version` in `plugin.json` for any change Claude Code should pick
up (it caches by version).
- Hook script path uses `${CLAUDE_PLUGIN_ROOT}` so it works wherever the
plugin gets installed.
- Keep the script idempotent: hooks may fire concurrently for parallel
tool calls; the `.tools` counter is flock-protected.
- The PPid-walk address resolution depends on a chain of
`script → claude → shell → kitty`. Don't break that by spawning the
script through extra wrappers.
## Why a Plugin (Not Dotfile-Managed)
- Reproducible: install via `claude plugin add`, no manual scp / nixos
rebuild loop for the script itself.
- Versioned: bumping `plugin.json.version` lets Claude Code re-cache
cleanly across hosts.
- Decoupled from emmett's NixOS config: the bar visuals are baked in via
patch (since they're hyprpanel internals), but the hook side is the
user's claude config and benefits from plugin lifecycle.