anthropics / anthropics/claude-code
[DOCS] plugins/README.md still describes security-guidance v1 (wrong hook type, wrong pattern count)
- Ngôn ngữ chính
- Python
- Star
- 145k
- Fork
- 23.1k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
### 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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- git, python
- Lĩnh vực
- documentation
- Loại issue
- Tài liệu
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 88/100