Make warn-plugin-cache-walk's fast exit test the command, not the whole payload
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- bash, git, shell
- 領域
- performance, testing, tooling
調査の方向性
Start with plugins/guardrails/hooks/warn-plugin-cache-walk.sh, especially lines 18, 23, and 26, and inspect the existing tests for this hook. Feed JSON on stdin with a realistic transcript_path under ~/.claude; verify a command without .claude/ or CLAUDE_CONFIG_DIR exits before jq and that verdicts stay unchanged. Measure per-call time before and after on Windows Git Bash and record it in the PR.
索引モデルが issue の本文から書いたものです。
説明
Problem
plugins/guardrails/hooks/warn-plugin-cache-walk.sh:18 is meant to exit early when a call cannot touch
~/.claude, before jq runs. It tests the whole PreToolUse payload for .claude/ or
claude_config_dir. Every payload carries transcript_path, which sits under ~/.claude/projects/,
so the test always matches and the early exit never fires. Every Bash call then pays for the jq
parse at :23; the real check on the command at :26 still decides correctly.
Evidence
- Read on
origin/mainthis pass: the test at:18runs on${INPUT,,}, the raw payload;:26
repeats it on.tool_input.command. - Inferred, not measured: the per-call cost of the extra
jqparse on Windows.
Proposed approach
Make the fast test ignore transcript_path and cwd (for example, match only text after
"command":), or drop :18 if it cannot be made cheaper than the jq parse. Measure before and
after on Windows Git Bash.
Acceptance criteria
- A Bash call whose command does not mention
.claude/orCLAUDE_CONFIG_DIRexits beforejqruns, with a transcript path under~/.claudein the payload. - Verdicts unchanged: existing tests pass, plus a test with a realistic
transcript_path. - Measured per-call time before and after, recorded in the PR.
Constraints and gotchas
- Never loosen the guard; this is a speed change with verdict parity.
- Test only by feeding JSON on stdin.
Context
Found while researching #21019 (closed). Part of the hook-speed work under #20549.
- 主要言語
- Shell
- スター
- 22
- フォーク
- 2
- 平均マージ
- 3時間 20分
- マージ済み PR(30日)
- 956
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
melodic-software/claude-code-plugins のほかの issue
-
host-run needs-research
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
melodic-software/claude-code-plugins#21140 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
melodic-software/claude-code-plugins#21103 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
host-run
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
melodic-software/claude-code-plugins#21053 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
melodic-software/claude-code-plugins#21021 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
melodic-software/claude-code-plugins#20960 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
melodic-software/claude-code-plugins の issue をすべて見る
似ている issue
-
documentation enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aws/aws-networking-best-practices#256 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
openai-directory
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
smores56/homelab-platform#289 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
omacom/omarchy#21787 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信