Skip to main content
plugin

semgrep — Claude Code plugin: what it does, how to install

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

no license ★ 23 updated 2026-10-22

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin install semgrep@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-official
Open on GitHub

What semgrep 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.

What it helps with

  • 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 for the agent

  • 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

How to install semgrep

Plugin marketplace

/plugin install semgrep@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-official

Step by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own

Questions about semgrep

How to install semgrep in Claude Code?

First, add the marketplace repository with /plugin marketplace add anthropics/claude-plugins-official. Then install the plugin using /plugin install semgrep@claude-plugins-official.

What does the semgrep plugin do?

It hooks into agent file-writing events to scan for code vulnerabilities, hardcoded tokens, and dependency issues. When findings appear, Claude Code rewrites the offending lines before you push.

How can I disable telemetry in Semgrep Guardian?

Add telemetry: false to ~/.semgrep/guardian.yml or set the SEMGREP_SEND_METRICS=off environment variable. This prevents Guardian from transmitting operational metrics to Semgrep servers.

Similar plugins

All plugins for Security →

Project sponsors

Companies that keep this analytics open