anthropics / anthropics/claude-code

[DOCS] plugins/README.md still describes security-guidance v1 (wrong hook type, wrong pattern count)

Abierto Apto para principiantes
#89,728 4 comentarios 0 reacciones 0 asignados Ver en GitHub
area:docs bug documentation
Lenguaje dominante
Python
Estrellas
145k
Forks
23.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

### Documentation Type

Incorrect/outdated documentation

### Documentation Location

https://github.com/anthropics/claude-code/blob/main/plugins/README.md

### Section/Topic

"Plugins in This Directory" table — the security-guidance row

### Current Documentation

| [security-guidance](./security-guidance/) | Security reminder hook that warns about potential security issues when editing files | **Hook:** PreToolUse - Monitors 9 security patterns including command injection, XSS, eval usage, dangerous HTML, pickle deserialization, and os.system calls |

### What's Wrong or Missing?

441892e ("Update security-guidance plugin") rewrote the plugin for v2 but
touched nothing outside plugins/security-guidance/, so the catalog row in
plugins/README.md still describes v1. Three things are wrong:

1. Hook type. The row says PreToolUse. hooks/hooks.json registers
SessionStart, UserPromptSubmit, PostToolUse and Stop — there is no
PreToolUse hook at all.

2. Pattern count. The row says 9. SECURITY_PATTERNS in hooks/patterns.py
has 25 entries.

3. Missing layers. v2 added two review layers the row never mentions: the
Stop-hook LLM diff review, and the agentic reviewer that runs on
`git commit` / `git push` (PostToolUse with matcher Bash, gated by
`if: Bash(git commit:*)` and `if: Bash(git push:*)`).

The plugin's own README (plugins/security-guidance/README.md) is accurate
and already documents all three layers — only the catalog summary drifted.

### Suggested Improvement

Replace the row with one derived from hooks.json and patterns.py:

| [security-guidance](./security-guidance/) | Three-layer security review of Claude-generated code: regex pattern warnings on edits, an LLM review of the diff when Claude finishes a turn, and an agentic reviewer on `git commit`/`git push` | **Hooks:** PostToolUse - Warns on ~25 known-dangerous patterns (command injection, XSS, `eval`, unsafe deserialization, disabled TLS verification, weak crypto) when editing files
PostToolUse[Bash] - Agentic commit/push review that traces data flow across files
Stop - LLM review of the git diff, fed back so Claude can fix findings first
SessionStart - Prepares the Agent SDK environment the reviewers run in |

Notes on the wording:
- The pattern categories come from the actual ruleName values in
patterns.py (child_process_exec, innerHTML_xss, eval_injection,
pickle_deserialization, tls_verification_disabled, aes_ecb_mode, ...).
- "~25" matches the plugin README's own phrasing rather than pinning an
exact number that the next added pattern would invalidate.

I have this as a one-line commit on a fork, if that's easier to pull in
than retyping the table row:
https://github.com/chanmilee-fe/claude-code/commit/d82822b07cd2c66ec2f56acdb3705f3841b8a6ef

(I tried opening a PR first, but the repo restricts PR creation to
collaborators.)

### Impact

Medium - Makes feature difficult to understand

### Additional Context

Two related items found in the same pass — happy to file separately:

- marketplace.json lists security-guidance at version 1.0.0, while
plugins/security-guidance/.claude-plugin/plugin.json says 2.0.0.

- The code-review row in the same table has drifted the same way: it lists
"5 parallel Sonnet agents", but commands/code-review.md launches 4, two of
which are Opus. That plugin's own README additionally documents a 0-100
confidence scoring system with an 80 threshold — including a section on
how to adjust the threshold — that no longer exists in the command file.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Read plugins/README.md alongside plugins/security-guidance/hooks/hooks.json, hooks/patterns.py, and plugins/security-guidance/README.md. Verify the hook names, pattern count, and three review layers against those sources. Done means the security-guidance catalog row accurately describes the current v2 plugin without outdated v1 details.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, python
Área
documentation
Tipo de issue
Documentación
Dificultad
1/5
Tiempo estimado
Menos de una hora
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
88/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.