Agent skill · Security

semgrep

Run Semgrep static analysis scan on a codebase using parallel subagents. Supports two scan modes — "run all" (full ruleset coverage) and "important only" (high-confidence security vulnerabilities). Automatically detects and uses Semgrep Pro for cross-file taint analysis when available. Use when asked to scan code for vulnerabilities, run a security audit with Semgrep, find bugs, or perform static analysis. Spawns parallel workers for multi-language codebases.

trailofbitsgithub.com/trailofbitsGitHub ↗
claude-codecan modify filesships scriptsCC-BY-SA-4.0
Install
npx skills add trailofbits/skills --skill semgrep --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 8
SKILL.md size: 9 KB
Bundled scripts: yes
Allowed tools: BashReadGlobTaskAskUserQuestionTaskCreateTaskListTaskUpdate
Path: plugins/static-analysis/skills/semgrep/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 6,426
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Semgrep Security Scan Run a Semgrep scan with automatic language detection, parallel execution via Task subagents, and merged SARIF output. ## Essential Principles 1. **Always use `--metrics=off`** — Semgrep sends telemetry by default; `--config auto` also phones home. Every `semgrep` command must include `--metrics=off` to prevent data leakage during security audits. 2. **User must approve the scan plan (Step 3 is a hard gate)** — The original "scan this codebase" request is NOT approval. Present exact rulesets, target, engine, and mode; wait for explicit "yes"/"proceed" before spawning scanners. 3. **Third-party rulesets are required, not optional** — Trail of Bits, 0xdea, and Decurity rules catch vulnerabilities absent from the official registry. Include them whenever the detected language matches. 4. **Spawn all scan Tasks in a single message** — Parallel execution is the core performance advantage. Never spawn Tasks sequentially; always emit all Task tool calls in one response. 5. **Always check for Semgrep Pro before scanning** — Pro enables cross-file taint tracking and catches ~250% more true positives. Skipping the check means silently missing critical inter-file vulnera

What's inside
Steps it walks through
  1. Essential Principles
  2. When to Use
  3. When NOT to Use
  4. Output Directory
  5. Prerequisites
  6. Scan Modes
  7. Orchestration Architecture
  8. Workflow
  9. Agents
  10. Rationalizations to Reject
  11. Reference Index
  12. Success Criteria
Ships with 7 files
  • agents/openai.yaml
  • assets/trail-of-bits-mark.svg
  • references/rulesets.md
  • references/scan-modes.md
  • references/scanner-task-prompt.md
  • scripts/merge_sarif.py
  • workflows/scan-workflow.md
Commands it runs
Resolve output directory
if [ -n "$USER_SPECIFIED_DIR" ]; then
else
while [ -e "${BASE}_${N}" ]; do
done
fi
mkdir -p "$OUTPUT_DIR/raw" "$OUTPUT_DIR/results"
semgrep --pro --validate --config p/default 2>/dev/null && echo "Pro available" || echo "OSS only"
uv run {baseDir}/scripts/merge_sarif.py $OUTPUT_DIR/raw $OUTPUT_DIR/results/results.sarif
More from skills
All skills →
About this skill
What does the semgrep skill do?

Run Semgrep static analysis scan on a codebase using parallel subagents. Supports two scan modes — "run all" (full ruleset coverage) and "important only" (high-confidence security vulnerabilities). Automatically detects and uses Semgrep Pro for cross-file taint analysis when available. Use when asked to scan code for vulnerabilities, run a security audit with Semgrep, find bugs, or perform static analysis. Spawns parallel workers for multi-language codebases.

How do I install it?

Run `npx skills add trailofbits/skills --skill semgrep --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From trailofbits/skills, a repository with 6,426 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going