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.
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/semgrepRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/TerminalSkills/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
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
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
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.
