/crg:security-sweep [path, rule id, or severity floor]from crg
Scans codebase for dangerous constructs using graph-based reachability analysis, ranking findings by whether untrusted input can actually reach them via call paths.
Ships in crg. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Scan the codebase for dangerous constructs, then use the graph to answer the question a flat scanner cannot: can untrusted input actually reach this? A medium-severity finding in a request handler outranks a critical one in dead code, and only the call graph can tell them apart.
Command surface: run the local CLI through the coding harness shell. Examples
use the installed crg command; from a source checkout,
prefix it with uv run. No MCP mapping is required.
Make the graph current with crg graph build --base HEAD --repo-root "<path>". Findings are attached to graph nodes, so anything unindexed is unscanned.
Read the active ruleset with crg security rule_list --engine heuristic before scanning, and check which languages each rule declares. This determines what a clean result is worth -- see Coverage Limits below.
Run the Tier 1 scan: crg security scan --engine heuristic --repo-root "<path>". It returns total, by_severity, by_rule, tags_by_node, and suppressed_count. Tier 1 is regex matching over the source of function, class, and method nodes -- fast, no external tool, no data-flow analysis.
Run Tier 2 when it is available: crg security scan --engine semgrep --repo-root "<path>". Semgrep is not installed with crg: it needs the semgrep CLI on PATH (uv tool install semgrep).
{"error": ..., "engine": "semgrep"} with a non-zero exit.Rank findings by reachability -- the step that makes this a graph sweep rather than a grep. For each tagged node, walk backwards toward the entry points:
crg query query --pattern callers_of --target "<node>" --repo-root "<path>"Confirm the source-to-sink path before filing anything. Tier 1 matches text, not data flow, so a match proves a dangerous construct exists, not that untrusted input reaches it. For each candidate:
subprocess call built from a hardcoded constant is not an injection; the same call built from a request field is.crg query query --pattern callees_of --target "<node>" --repo-root "<path>" to confirm what the function actually invokes when the match is ambiguous.Triage the residue into suppressions. For rules that are structurally inapplicable to this codebase, or findings confirmed as false positives:
crg security suppress --rule-id "<rule_id>" --repo-root "<path>" -- persists to security-suppressions.json next to the graph DB (<path>/.crg/ for the CLI)--remove to reverse a suppressionExport when the result feeds another system: crg security report --format sarif --repo-root "<path>" returns SARIF v2.1.0; use --format json to re-emit the cached payload. Both replay the last scan rather than rescanning.
Report:
## Security Sweep: <repo>
### Coverage
- **Tier 1 (heuristic)**: N rules active, applicable to <languages>
- **Tier 2 (semgrep)**: run / not installed
- **Unscanned**: <languages present in the repo with no applicable rules>
- **Suppressed rules**: <rule_id -- justification>
### Priority 1 -- Reachable from an entry point
- **<rule_id>** (<severity>) at `<file>:<line>` in `<node>`
- Reached by: <entry point> -> <caller> -> <node>
- Tainted input: <where the value comes from>
- Fix: <specific change>
### Priority 2 -- Reachable, input not confirmed untrusted
- <finding, and what would have to be true for it to matter>
### Priority 3 -- Not reachable from any entry point
- <finding, plus whether the code is dead or merely unreferenced here>
### Dismissed
- <finding> -- <why it is not a vulnerability>
### Recommendation
1. <ordered, actionable>
Rank on reachability first, severity second. Severity alone over-reports.
| Reachability | CRITICAL / HIGH | MEDIUM | LOW |
|---|---|---|---|
| Entry point reaches it with untrusted input | Priority 1 | Priority 1 | Priority 2 |
| Reachable, input provenance unconfirmed | Priority 2 | Priority 2 | Priority 3 |
| No caller path from any entry point | Priority 3 | Priority 3 | Dismiss with note |
| Test fixture or example code | Dismiss with note | Dismiss | Dismiss |
State these in the report whenever they apply -- a sweep that hides them is worse than no sweep.
.code-review-graphignore, or in a repository not federated into the graph, is invisible.onboard-repo -- index the codebase and identify entry points firstimpact-audit -- scope the blast radius of the fix once a finding is confirmedreview-delta / review-pr -- catch a new sink at review time rather than in a later sweepWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
6 skills in this plugin
/impact-auditBlast radius of a change you have not made yet -- traces a symbol across federated repositories, splits impact per repo, and reports what must ship together./onboard-repoIndex an unfamiliar codebase into the knowledge graph, then produce a first orientation map -- entry points, most-depended-upon modules, hotspots, test topology./refactor-checkSafety analysis before refactoring -- dependency graph, test coverage, public API exposure, blast radius verdict./review-deltaReview uncommitted changes using impact analysis. Quick local delta review with blast-radius detection./review-prComprehensive PR review -- full branch diff against base, commit-by-commit analysis, breaking change detection, conventional commit verification.npx claudepluginhub n24q02m/claude-plugins --plugin crg2 plugins ship this exact skill · first indexed Nov 29, 2026
Other plugins' skills for the same job