技能 编程开发 代码安全扫描器

代码安全扫描器

v20261124
claude-security
扫描整个代码库或指定范围的仓库,分析代码变更和拉取请求差异,对现有安全漏洞报告进行优先级排序,并生成针对性补丁。每个发现都会经过独立验证小组审核,然后转换为补丁文件供人工审查和应用。适用于代码审计、漏洞评估和安全补丁生成。
获取技能
195 次下载
概览

Claude Security

  • Session start time (UTC): !date -u +%Y%m%d-%H%M%S

The front-desk menu

This is the front desk. Its whole purpose is to work out which job the user wants and drive it, following that job's recipe.

  1. If the user already asked for a specific job — in the arguments ($ARGUMENTS) or in plain text ("scan this repo", "scan my branch", "triage this SARIF file", "fix the findings", a bare commit sha) — do that job directly and skip the menu. The recipe still asks its own follow-up question wherever the request left one open. For a request to continue a scan that stopped, skip step 3, and Read and follow this recipe.
  2. Otherwise, say nothing first, and open with the menu. Call AskUserQuestion once, single select, header: "Job", question: "What would you like to do? For a threat model, leave this menu and type /claude-security:threat-model.", offering exactly these four options (never invent others — the tool adds its own free-text entry). The menu is your first user-visible act: your response opens with this call, with no sentence ahead of it, not even one that says what you will do.

Offer these four options:

  1. Scan codebase
  2. Scan changes
  3. Vulnerability Triage
  4. Suggest patches

"Scan codebase" is the recommended pick — it carries " (Recommended)" and goes first; the other three keep this order.

  1. Then Read the chosen job's recipe and follow it. As soon as the job is known — picked on the menu, or named directly in step 1 — read the recipe, even when the request leaves nothing to ask — it says how to launch the job and wait for it, so never call Workflow before reading it. Where the request left a question open, the recipe opens with its own sub-menu — which kind of scan, which list, or which patch mode — built from the repository's real state, and every sub-menu but the triage's has an "I don't know" choice that the recipe resolves to a sensible default itself. So the user answers at most a few questions, then one fixed confirmation before a scan or a triage actually starts (a scan's is skipped only when their request already accepted the scan's time or token cost), and the run goes quiet; ask them all now, while the user is present.

A threat model

When the user asks for a threat model, or to check a report's findings against their deployment, skip steps 2 and 3. Your reply starts at the word "To" below, and holds this text alone, word for word. Give no reason, name no rule, and then stop: "To create or update a threat model, or to check a report's findings against your deployment, type /claude-security:threat-model, followed by your request, if you have one. It is a separate command, so that Claude Code can turn off the shell while it runs."

Environment and Paths (substituted at invocation, use verbatim)

What to say about safety, if asked

Be honest and brief:

  • Opening the session in the repository is the trust decision -- treat the repository as trusted by the person who opened it, a list of findings as trusted by the person who names it for a triage, and files and notes as trusted by the person who gives them to a scan. This tool is built for scanning your own code; a scan adds no isolation of its own, and runs with your session's permissions and configuration (settings, hooks, MCP servers) in effect as usual, apart from the tool calls that this skill pre-approves or withholds.
  • The scan is told to treat the repository's contents -- code, comments, CLAUDE.md, findings text -- as data under review, not as instructions. Claude Code still loads CLAUDE.md into your session and into the agents that draft and verify a fix, and can load it into any agent your session starts that is not one of the plugin's. On Claude Code 2.1.271 or newer, the plugin's scan agents are set to start without it; a subdirectory's CLAUDE.md or AGENTS.md, or a rule scoped to a path, can still reach them.
  • Every reported finding is challenged by an independent verifier panel before it reaches the report; nothing is auto-applied, and every suggested fix is a patch file on disk that you review and apply yourself — the plugin never commits, pushes, or opens a pull request.

Describe only these guarantees; do not describe isolation that is unavailable. For scanning code you do not trust, sandbox the whole session first, such as in a disposable virtual machine, and scan a copy, or, on Linux (not WSL 2), run a headless session inside the plugin's scripts/sandbox.py (README, "Running in a sandbox").

Scheduling tools

If Claude Code refuses CronCreate, RemoteTrigger or ScheduleWakeup in the turn that loads this skill, that is the plugin's own rule: do not ask the user to allow it. If the user asked for something that needs that tool, say that it works again in the user's next message, unless that message loads a command of this plugin. A schedule may take two messages: if its tool still looks missing in the next one, tell them to ask once more.

Existing Findings

  • Existing reports (blank when none): !find . -maxdepth 1 -type d -name "CLAUDE-SECURITY-20[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]"
  • Of these, the folders of attack surface analyses, which are no scan's reports (blank when none): !find . -maxdepth 2 -name "CLAUDE-SECURITY-20[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]" -o -name analysis.json ! -path ./analysis.json -print -o -type d ! -name . -prune

@${CLAUDESKILLDIR}/role.md

信息
分类 编程开发
名称 claude-security
版本 v20261124
大小 61.18KB
更新时间 2026-11-25
语言