semgrep

semgrep is a skill for Claude Code from siva01c/claude-plugins. It costs 169 tokens per session (2,550 once invoked), scanned A, original, MIT.

A security scan for custom Drupal PHP and JavaScript code using Semgrep, a tool that finds code patterns linked to security problems. It checks custom modules and themes against general PHP, OWASP Top 10, secrets, and Drupal-specific rules.

In plain words
What is it for?
Use it to scan custom Drupal modules and themes for common security weaknesses and hard-coded credentials, then feed the findings into a broader Drupal security review.
Why use it?
It provides repeatable findings with rule names and source lines, so a security review is not based only on manually reading code. It also helps spot issues such as injection, cross-site scripting, unsafe functions, and exposed secrets.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the security-tools plugin — 2 skills shipped together

Good fit Use it to scan custom Drupal modules and themes for common security weaknesses and hard-coded credentials, then feed the findings into a broader Drupal security review.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/siva01c/claude-plugins/semgrep
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add siva01c/claude-plugins --skill semgrep
Clone the repo
git clone --depth 1 https://github.com/siva01c/claude-plugins

Made for: Claude Code.

Or install security-tools, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for semgrep

README.md
[![agentmods](https://agentmods.dev/badge/skills/siva01c/claude-plugins/semgrep/github.svg)](https://agentmods.dev/skills/siva01c/claude-plugins/semgrep)
Your own site
<a href="https://agentmods.dev/skills/siva01c/claude-plugins/semgrep"><img src="https://agentmods.dev/badge/skills/siva01c/claude-plugins/semgrep/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for semgrep

Your own site · 80×15
<a href="https://agentmods.dev/skills/siva01c/claude-plugins/semgrep"><img src="https://agentmods.dev/badge/skills/siva01c/claude-plugins/semgrep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 169 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,550 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00169 $0.02550
Opus 5.5 $0.00068 $0.01020
Sonnet 5.5 $0.00034 $0.00510
Haiku 4.5 $0.00017 $0.00255

Measured yesterday against content hash f533da20cae2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

semgrep scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

security-tools/skills/semgrep/SKILL.md · 211 lines

How it starts

The opening of the file, as written. The whole thing — 211 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Semgrep SAST for Drupal

A security review that rests only on reading code misses what nobody read. Semgrep gives it a deterministic floor: the same code always gives the same findings, each with a rule id and a line. The review then judges those findings and goes on to what a pattern cannot see (business logic, object-level access, data flow across services).

Use it together with:

  • owasp-asvs (this plugin) — the requirement each finding maps to;
  • drupal-dev-tools:drupal-security-review — the manual checklist the scan feeds.

What is scanned

Only custom code — contrib and core have their own security process:

web/modules/custom
web/themes/custom

Adjust to the project's docroot (docroot/, html/). Skip paths that do not exist; a scan of a missing path is an error, not an empty result.

Rule sets

Config What it covers
p/php General PHP security rules (exec, eval, unserialize, weak crypto…)
p/owasp-top-ten OWASP Top 10 rules across languages, incl. JavaScript in themes
p/secrets Hard-coded keys, tokens and passwords
rules/drupal.yml Custom Drupal PHP rules, below
rules/drupal-routing.yml Routes in *.routing.yml without an access requirement

rules/ is the directory next to this file. Pass the two rule files explicitly — the directory also holds the test fixtures, which are not rules.

The registry packs (p/…) are downloaded at scan time, so they need network access. Offline, run only the two local files and say in the report that the registry packs were not run.

Custom Drupal rules

Rule id Finds ASVS Severity
drupal-sqli-concatenated-query ->query() / db_query() with concatenated, interpolated or sprintf()-built SQL V1.1.4 ERROR
drupal-xss-markup-unescaped A variable in #markup without t(), Xss::filter() or Html::escape() V1.1.1, V1.2.1 WARNING
drupal-xss-markup-create Markup::create() with a variable that was not filtered V1.1.1, V1.2.1 WARNING
drupal-superglobal-access $_GET, $_POST, $_REQUEST, $_COOKIE, $_FILES V2.1.1 WARNING
drupal-static-call-in-di-class \Drupal::…() in a class with a constructor or create() — (design) INFO
drupal-debug-output var_dump, print_r, dpm, kint, dump, dd … V12.1.1, V12.1.2 WARNING
drupal-route-without-access-check A route with no _permission, _access, _custom_access, _entity_access, _role or _user_is_logged_in V8.1.3, V4.2.1 WARNING

Read the full file on GitHub · 211 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 211 lines · 169 tokens per session scan A f533da20cae2

Subscribe to this mod's changes

semgrep is a skill published in the GitHub repository siva01c/claude-plugins (16 stars, last pushed yesterday), licensed MIT. It adds 169 tokens to every session and 2,550 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-06.

Related

semgrep compared with skills from other repositories

semgrep next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
semgrepsiva01c/claude-pluginsSkill16yesterdayMITA169Claude Code
fix-ci-until-greenjim60105/copilot-promptSkill2221d agoGFDL-1.3A134Claude Code, Codex
unity-editor-remotejim60105/copilot-promptSkill2221d agoGFDL-1.3A124Claude Code, Codex
diagnosing-bugsfabiandistler/agentsSkill23d agononeA40Claude Code, Codex
refactoringfabiandistler/agentsSkill23d agononeA50Claude Code, Codex
incident-postmortemmohitagw15856/pm-claude-skillsSkill1.5kyesterdayMITA87Claude Code, Codex
agent-design-reviewmohitagw15856/pm-claude-skillsSkill1.5kyesterdayMITA91Claude Code