Make warn-plugin-cache-walk's fast exit test the command, not the whole payload
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- bash, git, shell
- Área
- performance, testing, tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Shell
- Estrellas
- 22
- Forks
- 2
- Merge medio
- 3 h 20 min
- PR fusionados (30 d)
- 956
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de melodic-software/claude-code-plugins
-
harness-ops plugins: recheck the userConfig 'unset key renders the literal placeholder' recordAbiertohost-run needs-research
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
melodic-software/claude-code-plugins#21140 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
melodic-software/claude-code-plugins#21103 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
host-run
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
melodic-software/claude-code-plugins#21053 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
melodic-software/claude-code-plugins#21021 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
melodic-software/claude-code-plugins#20960 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de melodic-software/claude-code-plugins
Issues similares
-
documentation enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aws/aws-networking-best-practices#256 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
ChatGPT directory is behind mainAbiertoopenai-directory
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
smores56/homelab-platform#289 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
omacom/omarchy#21787 · 3 comentarios ·
Los mantenedores suelen responder en 1 día