opengrep

opengrep is a skill for Claude Code, Codex from fmind/dot. It costs 52 tokens per session (1,040 once invoked), scanned A, original, MIT.

A semantic security scanner that searches source code for risky patterns using configurable rules. It can produce machine-readable JSON or SARIF reports, a format used by code-scanning tools.

In plain words
What is it for?
Use it to run opt-in SAST scans, pin a rules version, suppress justified findings inline, and export scan results.
Why use it?
It helps detect security problems that simple text searches may miss and can make findings available to automated checks.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/fmind/dot/opengrep
Any agent
npx skills add fmind/dot --skill opengrep
Clone the repo
git clone --depth 1 https://github.com/fmind/dot

Made for: Claude Code, Codex.

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 opengrep

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmind/dot/opengrep.svg)](https://agentmods.dev/skills/fmind/dot/opengrep)
Your own site
<a href="https://agentmods.dev/skills/fmind/dot/opengrep"><img src="https://agentmods.dev/badge/skills/fmind/dot/opengrep.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,040 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00052 $0.01040
Opus 5 $0.00026 $0.00520
Sonnet 5 $0.00010 $0.00208
Haiku 4.5 $0.00005 $0.00104

Measured yesterday against content hash 09e07f2adcc5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opengrep 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.

skills/opengrep/SKILL.md · 60 lines

How it starts

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

Opengrep

Semantic code-pattern scanning (SAST) with opengrep, the LGPL fork of the Semgrep engine; it is opt-in as check:sast, and secure decides when a repository adopts it.

Commands

opengrep scan --error --quiet --config .opengrep/rules/go --config .opengrep/rules/python .  # check:sast: exit 1 on findings, findings only
opengrep scan --error --quiet --config .opengrep/rules/go --json --output opengrep.json .    # machine-readable report
opengrep scan --error --quiet --config .opengrep/rules/go --sarif --output opengrep.sarif .  # SARIF for code scanning
opengrep scan --experimental --config git+https://github.com/opengrep/opengrep-rules#<ref> . # clone-on-run pin, no checkout task
PAGER=cat opengrep scan --help                                                               # the help is a man page

Mise Tasks

The rules are pinned by commit into an ignored directory so the check stays offline and reproducible; add .opengrep/ to .gitignore:

[tasks."install:sast"]
description = "Fetch the pinned opengrep rules"
run = "test -d .opengrep/rules || (git init -q .opengrep/rules && git -C .opengrep/rules fetch -q --depth 1 https://github.com/opengrep/opengrep-rules <commit> && git -C .opengrep/rules checkout -q FETCH_HEAD)"

[tasks."check:sast"]
description = "Scan source for insecure code patterns (opengrep)"
depends = ["install:sast"]
run = "opengrep scan --error --quiet --config .opengrep/rules/go --config .opengrep/rules/python ." # one --config per language directory

The rules repository ships one directory per language, including go/, python/, typescript/, terraform/, dockerfile/, and yaml/.

Workflow

  1. Adopt: pin opengrep in mise.toml [tools], pin an opengrep-rules commit in install:sast, and add check:sast to the depends of check per mise.
  2. Triage: fix each finding; suppress a true false positive inline with // nosemgrep: <rule id> plus a reason, where the id is the id field of the rule file. Exclude generated paths in .semgrepignore.
  3. Report: pass --json or --sarif when a report is needed; the gate itself stays text-only.

Read the full file on GitHub · 60 lines

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 · 60 lines · 52 tokens per session scan A 09e07f2adcc5

Subscribe to this mod's changes

opengrep is a skill published in the GitHub repository fmind/dot (4 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 1,040 once invoked, about $0.0003 per session on Opus 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-09-03.