semgrep Skill (Trail of Bits) for Claude: What It Does and How to Install It
Makes Claude run a Semgrep security scan on your code, show you the plan first, and merge the results into one SARIF file.
- Installs
- 9.8K
- on skills.sh
- Stars
- 7.9K
- on GitHub
- Files
- 8
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
This is Trail of Bits' Semgrep skill, not an official Semgrep product. Claude detects the languages in a folder, picks rulesets, shows you the plan and waits for your yes. Then it runs the scans and merges the results into one SARIF file. Two modes are available: run everything, or keep only medium-to-high confidence security findings.
It triggers when you ask for a vulnerability scan, a Semgrep audit or static analysis. It needs the Semgrep command line tool installed. The scan runs a bundled shell script, and the merge step runs a bundled Python script through uv. Semgrep Pro is used when it is available.
Good for
- Developers who want a first-pass security scan before code review
- Security reviewers who want to see and approve rulesets before anything runs
- Teams that need results as SARIF for other tools
Install semgrep
Claude Code
- 1
Copy this prompt.
Install the semgrep skill in Claude Code. Run this command: /plugin marketplace add trailofbits/skills /plugin install static-analysis@trailofbits Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Semgrep CLI.
Pick one route. The plugin routes install the whole static-analysis plugin: 3 skills (codeql, semgrep, sarif-parsing) and 2 JS workflows, counted from the plugin folder in the repo tree, which has no hooks or MCP config files. The skills CLI route installs only this skill and not the /static-analysis:semgrep-scan workflow. The skill needs the Semgrep CLI, uv and git on your machine.
Built from the package data we hold. Not yet tested by us.
What's in the skill
When it loads
Runs a Semgrep security scan over a codebase: detects languages, selects rulesets, presents the plan for explicit approval, then runs every approved ruleset through scripts/run-scans.sh, which batches the semgrep processes and writes scans.json, and merges the output to SARIF. Supports two scan modes, "run all" for full ruleset coverage and "important only" for security findings at medium-to-high confidence and impact. Uses Semgrep Pro for cross-file taint analysis when it is available. Use when asked to scan code for vulnerabilities, run a security audit with Semgrep, find bugs, or perform static analysis. For the same scan without the approval gate, use the /static-analysis:semgrep-scan workflow.
Sections in SKILL.md
- Essential Principles
- When to Use
- When NOT to Use
- Output Directory
- Prerequisites
- Scan Modes
- Orchestration Architecture
- Running it as a Workflow
- Workflow
- Workflow and agents
- Rationalizations to Reject
- Reference Index
- Success Criteria
Key facts
- Author
- Trail of Bits (repo owner); the static-analysis plugin lists Axel Mierczuk & Paweł Płatek as authors
- Installs on skills.sh
- 9,843 (Nov 2, 2026)
- Last repo commit
- Oct 28, 2026
- Audits on skills.sh
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: warn
- What it includes
- 9 files including SKILL.md: 2 reference files, a workflow guide, run-scans.sh, merge_sarif.py, a test file, an openai.yaml and a logo
What it includes
Finds languages, checks for Semgrep Pro, creates the output folder
Output goes to ./static_analysis_semgrep_1 by default, or a folder you name. It runs semgrep --pro --validate to check Pro.
Runs code ·
Step 1: detectRun all, or important only (medium-to-high confidence security)
Rulesets come from references/rulesets.md and include third-party rule repos for matching languages.
Read ·
Step 2: choose mode and rulesetsShows the exact plan and waits for your yes
Your original request does not count as approval. Claude asks with AskUserQuestion.
Read ·
Step 3: approval gateClones rule repos, builds each semgrep command and runs them in batches
Writes scans.json with what ran, failed or was skipped. Every semgrep call uses --metrics=off.
Runs code ·
Step 4: scripts/run-scans.shMerges per-scan SARIF with merge_sarif.py and reports
Runs the Python script through uv, then deletes the cloned repos folder.
Delete ·
Step 5: merge and reportPlugin workflow that runs the same scan without the approval step
Takes a JSON object with target and mode. Plugin only, not part of a skills-only install.
Runs code ·
/static-analysis:semgrep-scan
From the official docs
Permissions
Medium risk
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It runs shell scripts and a CLI scanner
Step 4 runs scripts/run-scans.sh, which starts semgrep processes in batches. Step 5 runs merge_sarif.py through uv. SKILL.md allows Bash, so review the plan at the approval step. github.com
It clones third-party rule repos
run-scans.sh runs git clone --depth 1 for each third-party URL, such as the Trail of Bits, 0xdea and Decurity rule repos listed in rulesets.md. Decline any you do not want at the approval step. github.com
It deletes the repos folder it cloned
Step 5 removes the repos folder inside the output directory. Name an output folder that holds nothing else you need. github.com
Telemetry is switched off by the skill
SKILL.md says every semgrep command must include --metrics=off. Check this if you run semgrep by hand. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | The plugin README says the scan does not use --autofix and writes only inside the output folder, but the skill has no read-only switch. |
|---|---|
| Talks to | github.com (git clone of third-party rule repos listed in rulesets.md). Semgrep registry rulesets named in the plan (p/... identifiers) |
| Sign-in and keys | SKILL.md does not ask for an API key. Semgrep Pro availability is checked with semgrep --pro --validate, which depends on your own Semgrep login. |
| Scopes |
|
Questions
What does the semgrep skill do?
It makes Claude run a Semgrep scan in five steps. Claude detects languages, picks rulesets, asks you to approve the plan, runs the scans and merges the results into one SARIF file.
How do I install it?
Use the install box at the top of this page. It offers the whole static-analysis plugin for Claude Code and Codex, and a skills CLI route for this skill only. You also need the Semgrep CLI installed on your machine.
Is this the official Semgrep skill?
No. It is by Trail of Bits, a security consultancy, in its trailofbits/skills repo. Semgrep has its own MCP server, which has a separate page here: Semgrep MCP server.
Do I need a Semgrep account or Pro license?
Not to start. SKILL.md lists the Semgrep CLI as required and Semgrep Pro as optional. With Pro, it adds cross-file taint analysis. Without Pro, scans cannot track data flow across files.
Does it send my code or data anywhere?
SKILL.md says every semgrep command uses --metrics=off because Semgrep sends telemetry by default. The script clones third-party rule repos from GitHub, and the plan names Semgrep registry rulesets such as p/python. Read the plan in step 3 before you approve it.
What is the difference between the skill and /static-analysis:semgrep-scan?
The skill stops at step 3 and waits for you to approve the rulesets. The plugin workflow does not stop; passing a target is the opt-in. The plugin README says the scan is read-only over the target, with every write inside the output folder.
Is it safe?
It runs a bundled shell script that clones public rule repos, runs semgrep and deletes the folder it cloned into. It is designed to need your approval first. Point it at a code folder you trust and give it an output folder that is not your source tree.
Information
updated Nov 2, 2026
- Repository
- trailofbits/skills
- Folder
plugins/static-analysis/skills/semgrep
Sources
Docs, issue trackers and discussions this page is built from.
Show all 7Hide
- trailofbits/skills README · github.com
- static-analysis plugin README · github.com
- semgrep SKILL.md · github.com
- scan-workflow.md · github.com
- rulesets.md · github.com
- run-scans.sh · github.com
- merge_sarif.py · github.com