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 TerminalSkills

Semgrep is an open-source static analysis tool that finds bugs, security issues and anti-patterns by matching code patterns. This skill helps developers scan repositories, write custom YAML rules, auto-fix findings and add SARIF scans to CI.

  • Score 49
  • 224 stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install semgrep

Built from the published package, never by AI.

git clone --depth 1 https://github.com/TerminalSkills/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

Semgrep is an open-source static analysis engine that matches code structure instead of plain text, so a rule reads much like the source it finds. The source says it supports 30+ languages. The CLI runs locally and offline with your own rules, and community rules come from the Semgrep Registry. Rules can be validated and unit-tested with inline markers.

The skill covers installing the CLI, running scans with registry rulesets or local rule files, writing custom YAML rules and applying autofixes. It also shows how to add a scan with SARIF output to GitHub Actions, either with a Semgrep platform account or with the open-source CLI alone. It is aimed at developers and teams who want security and code-quality checks in their code and CI pipelines.

Written from the project's SKILL.md and checked against it.

What it can do

  • Scan a repositoryRuns Semgrep scans with registry rulesets, local rules or rules chosen for the project's languages.
  • Write custom rulesWrites YAML rules with pattern operators, metavariable regexes, metadata and fixes.
  • Auto-fix findingsApplies rule fixes with --autofix and recommends reviewing the diff before committing.
  • Set up CI scansAdds a Semgrep scan with SARIF output to GitHub Actions or other CI.
  • Test rulesValidates rule files and runs inline ruleid and ok tests against them.

What you need

  • Python 3.10+, Homebrew on macOS/Linux, or the semgrep/semgrep Docker image
  • GitHub Actions for the CI workflow examples
  • SEMGREP_APP_TOKEN from a Semgrep platform account for semgrep ci

Try asking

  • Scan src/ for security problems with Semgrep and write a SARIF report.
  • Write a Semgrep rule that flags legacyAuth.check calls and autofix them.
  • Add a Semgrep scan with SARIF output to my GitHub Actions workflow.

Good to know

  • Homebrew no longer supports Intel Macs.
  • --config auto sends the project URL to the Registry and enables metrics.
  • Cross-file analysis and many Pro rules need a Semgrep account.
  • Pattern-based analysis can produce false positives and negatives.

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

Does Semgrep need an account?

The open-source CLI runs without one. The source says semgrep ci needs SEMGREP_APP_TOKEN from a platform account, and cross-file analysis and many Pro rules also need an account.

Which languages does Semgrep support?

The source says Semgrep supports 30+ languages.

Is Semgrep a full data-flow analyser?

No. The source says it is pattern-based rather than a full data-flow prover, so it can give false positives and negatives.

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 Apache-2.0 licence. The service it connects to may have its own pricing.

Is semgrep safe to use?

It scores 49 of 100. Grades: maintenance A, licence A, 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.