semgrep
Skill by semgrep
Runs Semgrep static analysis scans and helps write custom YAML detection rules. Built for developers and security teams who want quick, pattern-based code scanning across 30+ languages.
Install semgrep
Built from the published package, never by AI.
git clone --depth 1 https://github.com/semgrep/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/skills/semgrep ~/.claude/skills/semgrepRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/semgrep/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/skills/semgrep ~/.gemini/antigravity-cli/skills/semgrepAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill teaches an AI assistant to run Semgrep, a pattern-based static analysis tool, to scan code for security vulnerabilities and bugs. It covers scanning with built-in rulesets such as p/security-audit, p/owasp-top-ten and p/cwe-top-25, writing SARIF or JSON output, and excluding paths with .semgrepignore. It also shows how to suppress false positives with nosemgrep comments.
The skill explains how to write custom YAML rules using pattern matching or taint mode for data flow, and how to test them with ruleid and ok annotations. When Semgrep MCP tools are available, the assistant prefers them and falls back to the CLI otherwise. A GitHub Actions example is included. It is aimed at developers and security teams who want fast scans or project-specific detection rules.
Written from the project's SKILL.md and checked against it.
What it can do
- semgrep_scanScans code files for security vulnerabilities using built-in rulesets.
- semgrep_scan_with_custom_ruleScans inline code with a custom YAML rule the assistant has written.
- semgrep_findingsFetches existing findings from the Semgrep AppSec Platform for a repository.
- semgrep_rule_schemaReturns the full schema for writing Semgrep rules.
- get_supported_languagesLists all languages Semgrep supports.
- Custom rule creationGuides writing pattern matching and taint mode rules with test files first.
What you need
- Semgrep CLI, installable with pip, Homebrew or Docker
- Python 3 for the pip install
- Docker, if using the container option
Try asking
- Scan this project for security vulnerabilities using Semgrep.
- Write a custom Semgrep rule that flags eval on user input.
- Run the p/owasp-top-ten ruleset on the src folder and save SARIF output.
Good to know
- Pattern-based analysis may not track complex cross-function data flow.
- Pattern matching alone cannot separate vulnerable and safe calls. Taint mode is recommended for injection bugs.
- Custom rules are expected to pass all test annotations before use.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/semgrep/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to semgrep
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
semgrep: common questions
What does Semgrep check for?
The skill uses Semgrep rulesets for security issues such as OWASP Top 10 and CWE Top 25 vulnerabilities, plus code quality and team coding standards. Custom rules can target project-specific bug patterns.
Does it need the MCP server?
No. The skill says to use Semgrep MCP tools when they are available and to fall back to the CLI commands otherwise.
How are custom rules tested?
The skill requires test files with ruleid and ok annotations, written before the rule. Rules are run with semgrep --test and should pass without missed or incorrect lines.
How do I install semgrep?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is semgrep free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is semgrep safe to use?
It scores 78 of 100. Grades: maintenance A, licence F, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to semgrep?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
