Make warn-plugin-cache-walk's fast exit test the command, not the whole payload
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 70/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- bash, git, shell
- Bereich
- performance, testing, tooling
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Shell
- Sterne
- 22
- Forks
- 2
- Ø Merge
- 3 Std. 20 Min.
- Gemergte PRs (30 T.)
- 956
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus melodic-software/claude-code-plugins
-
harness-ops plugins: recheck the userConfig 'unset key renders the literal placeholder' recordOffenhost-run needs-research
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
melodic-software/claude-code-plugins#21140 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
melodic-software/claude-code-plugins#21103 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
host-run
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
melodic-software/claude-code-plugins#21053 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
melodic-software/claude-code-plugins#21021 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
melodic-software/claude-code-plugins#20960 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in melodic-software/claude-code-plugins
Ähnliche Issues
-
documentation enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
aws/aws-networking-best-practices#256 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
openai-directory
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
smores56/homelab-platform#289 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
omacom/omarchy#21787 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag