# semgrep

semgrep scans agent-written files for vulnerabilities, hardcoded tokens, and risky packages upon every write. Claude Code fixes issues before committing.

- plugin · `type=plugin` · Claude Code · ★ 23 repo stars
- Author: semgrep
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/semgrep/guardian/tree/HEAD/plugin
- Updated: 2026-10-22
- Security check: automated, 2026-11-16 (text and 8 script files) — warning: a command downloads a script and runs it right away (file plugin/skills/install-mfw/scripts/install-binary.sh). Do not run such commands without an explicit yes from the human.
- HTML: https://affpapa.org/en/nevibecode/plugins/semgrep

## What it does

Semgrep Guardian bundles an MCP server and lifecycle hooks into Claude Code to inspect generated files. Every time the agent writes or modifies a file, hooks trigger checks across your code, dependencies, and hardcoded secrets. When Semgrep flags an issue, Claude Code regenerates the snippet until clean or dismissed.

The MCP component lets the agent query Semgrep project data and explore security findings directly in the terminal. File edits and package manifests route to `scanner.semgrep.ai`, while authentication and binary verification go through `semgrep.dev`.

Running Guardian requires logging in to a Semgrep account. Telemetry to `telemetry.semgrep.dev` and background updates can be switched off inside `~/.semgrep/guardian.yml`. If Semgrep deprecates your installed binary version, the plugin halts with an error until automatic updates resume.

## Install

### Claude Code (native platform)

**Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin install semgrep@claude-plugins-official
```
In the agent chat (not a shell):
```text
/plugin marketplace add anthropics/claude-plugins-official
```

## When to use it
- catch hardcoded credentials in files generated by the agent
- fix code security flaws before pushing commits
- detect malicious packages in lockfiles and dependency manifests
- pull vulnerability details via MCP directly inside the terminal

## Example prompts
- Log in to Semgrep to initialize Guardian
- List supply chain findings and security issues in this repository
- Fix any vulnerabilities detected in the latest generated files

## Similar
- [write_semgrep_rule](https://affpapa.org/en/nevibecode/prompts/write-semgrep-rule.md) — prompt · ★ 44690 repo stars
- [semgrep-rule-creator](https://affpapa.org/en/nevibecode/skills/semgrep-rule-creator.md) — skill · 6400 installs
- [semgrep-rule-variant-creator](https://affpapa.org/en/nevibecode/skills/semgrep-rule-variant-creator.md) — skill · 5900 installs
- [security-reviewer](https://affpapa.org/en/nevibecode/skills/security-reviewer.md) — skill · 6700 installs
- [sast-scanning](https://affpapa.org/en/nevibecode/skills/sast-scanning.md) — skill · 415 installs
- [source-code-scanning](https://affpapa.org/en/nevibecode/skills/source-code-scanning.md) — skill · 217 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
