Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By kenimo49v0.1.0MITIn 1 marketplace
Read-only inspector for Claude Code's merged hook chain across user/project/local/plugin scopes. Bundled bash CLI plus slash commands for list, doctor, and events.
You run one by typing its /name in Claude Code.
Executables (bin/) — files in this plugin's bin/ directory are added to the Bash tool's PATH while the plugin is enabled.
1 caution to review before installing
A command runs shell commands (! syntax) when you invoke it
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.

Claude Code の hook 群 (user / project / local / plugin) を全部読んで、今この cwd で実際にどう発火するかを出す読み取り専用の CLI。
Claude Code の hook は複数の場所に分散して定義される。
~/.claude/settings.json (user scope)<cwd>/.claude/settings.json (project scope)<cwd>/.claude/settings.local.json (local scope)hooks/hooks.json (plugin scope)そして仕様上は マージ後の全 hook が発火する (加算型、同じ event に複数登録すれば全部順に走る)。だが「今この環境でマージ後にどうなっているか」を確認する公式コマンドは存在しない。
plugin を 3-4 個入れ、自作 hook も足すと、以下が読めなくなる:
bash "${CLAUDE_PLUGIN_ROOT}/hooks/foo.sh" の実体、そこにある?hook-chain-lens はそこを覗くための lens です。
git clone https://github.com/kenimo49/hook-chain-lens.git
ln -s "$(pwd)/hook-chain-lens/bin/hook-chain-lens" ~/.local/bin/hook-chain-lens
~/.local/bin に PATH が通っていれば以降 hook-chain-lens で呼べる。
Claude Code セッション内で /hook-chain-lens:list /hook-chain-lens:doctor /hook-chain-lens:events を打てるようにしたい場合はローカル marketplace 経由でインストール:
git clone https://github.com/kenimo49/hook-chain-lens.git
Claude Code 内で:
/plugin marketplace add /absolute/path/to/hook-chain-lens
/plugin install hook-chain-lens@hook-chain-lens-local
plugin は同梱の bin/hook-chain-lens を ${CLAUDE_PLUGIN_ROOT}/bin/hook-chain-lens として呼ぶ。追加のシンボリックリンクや PATH 設定は不要。
bash 4+, jq, coreutils。Linux / macOS 対応。
list — マージ後の hook chain を event 別に表示$ hook-chain-lens list
PreCompact:
1. [plugin:compact-ops]
type: command
command: bash "${CLAUDE_PLUGIN_ROOT}/hooks/precompact-backup.sh"
matcher: (none — fires on every PreCompact)
timeout: 30s
from: /home/you/.claude/plugins/cache/compact-ops-local/compact-ops/0.2.0/hooks/hooks.json
2. [plugin:compact-ops]
...
SessionStart:
1. [user] matcher: startup
2. [plugin:compact-ops] matcher: compact|resume
--event <NAME> で特定 event だけ表示 (例: --event PostToolUse)--cwd <DIR> で project/local scope の読み込み元を切り替え--json で機械可読 (パイプ後段で jq 加工向け)doctor — 診断$ hook-chain-lens doctor
⚠ [W1] "PreCompact" has 2 handlers with empty matcher
all fire on every PreCompact trigger (order-preserved). Confirm this is intended.
0 error(s), 1 warning(s), 0 info
検出ルール:
| コード | 深刻度 | 内容 |
|---|---|---|
| W1 | warn | 同一 event に空 matcher の handler が 2 つ以上 (全部毎回発火) |
| W2 | warn | 同一 event で同じ matcher を 2 つ以上の handler が共有 |
| W3 | error | command が参照するファイルが存在しない (${CLAUDE_PLUGIN_ROOT} 展開後) |
| W4 | warn | ファイルは存在するが実行/読み取り不可 |
| W5 | warn | timeout が異常に低い (1秒未満) |
| I1 | info | timeout が異常に高い (300秒超) |
| W6 | error | 未知の event 名 (typo 疑い) |
| W7 | warn | matcher を受け付けない event に matcher を書いている (dead field) |
doctor はエラーがあれば exit code 1 を返す (CI や pre-commit で使える)。
events — hook event の全一覧$ hook-chain-lens events
Matcher-supporting events (support the `matcher` field):
PreToolUse
PostToolUse
...
Matcher-less events (matcher field is ignored):
UserPromptSubmit
Stop
...
Claude Code の公式仕様では、hook は 加算型でマージされる (上位 scope が下位を上書きするのではなく、全部発火する)。hook-chain-lens list はこの仕様に沿って全 scope の全 handler を表示する。表示順は:
~/.claude/settings.json)<cwd>/.claude/settings.json)<cwd>/.claude/settings.local.json)hooks/hooks.json、installed_plugins.json 順)Managed (Enterprise) scope の読み取りは v0.2 以降で対応予定。
以下の両方を満たす plugin のみ hook 読み取り対象:
~/.claude/plugins/installed_plugins.json にエントリが存在~/.claude/settings.json の enabledPlugins["<key>"] が trueinstall 済みだが disable されている plugin は除外される (Claude Code の実挙動と一致)。
failures (fail-open で消えた失敗の集計)dry-run (matcher 適用シミュレーション)、--watch (ファイル変更検知で自動再表示)Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub kenimo49/hook-chain-lens --plugin hook-chain-lensPlugins from other owners that cover similar ground