semgrep — Claude Code skill: what it does, how to install
Runs a Semgrep static security audit on your codebase. It presents a plan for user confirmation and merges all findings into SARIF.
npx skills add trailofbits/skills --skill semgrep -a claude-codeWhat semgrep does
The skill runs static analysis across project files to detect security flaws. It identifies repository languages and checks whether Semgrep Pro is available. Every command enforces --metrics=off so scan data stays off remote telemetry servers.
Execution will not start without explicit user confirmation. The agent presents targets alongside rulesets from Trail of Bits, 0xdea, and Decurity, then waits for approval. The host environment must have the Semgrep CLI installed beforehand.
Two scan profiles are available: complete coverage or a filtered run targeting high-impact security findings. Running the open-source engine without a Pro license means cross-file taint analysis is skipped entirely, leaving inter-file data leaks undetected. Output files land in ./static_analysis_semgrep_1 and merge into results.sarif.
What it helps with
- run a static security audit before code review
- detect vulnerabilities with third-party rulesets like Trail of Bits and 0xdea
- merge multi-ruleset Semgrep scan results into a single SARIF file
- filter code findings by impact and confidence levels
Example prompts for the agent
- Run a semgrep security scan on this project using important only mode
- Scan this codebase with semgrep and save findings to ./static_analysis_semgrep_1
- Perform a semgrep static analysis and wait for my plan approval
How to install semgrep
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill semgrep -a claude-code2Manually: put the files in place
~/.claude/skills/semgrep/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/semgrep/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill semgrep -a codex2Manually: put the files in place
.agents/skills/semgrep/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill semgrep -a cursor2Manually: put the files in place
.cursor/skills/semgrep/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills semgrep2Manually: put the files in place
.github/skills/semgrep/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill semgrep -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/static-analysis/skills/semgrepManually: put the files in place
.devin/skills/semgrep/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill semgrep -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set35
The whole set →Similar
Questions about semgrep
How to install semgrep in Claude Code?
Run npx skills add trailofbits/skills --skill semgrep -a claude-code in your terminal.
What does the semgrep skill do?
It identifies project languages, prepares a ruleset plan for user approval, runs Semgrep CLI scans in parallel, and merges all findings into a SARIF report.
What is the difference between open-source Semgrep and Semgrep Pro here?
Semgrep Pro adds cross-file taint tracking and extra language coverage, whereas the free open-source engine only inspects code within individual files.