Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 78
  • 352 stars
  • NOASSERTION
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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/semgrep

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install semgrep in Claude Code

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

A

No 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 →

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.

semgrep Install

Add to stack

Loading.