Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

variant-analysis

Skill by CraftOS-dev

Finds similar vulnerabilities and bugs across a codebase after an initial issue is found. It is for security analysts and developers who build CodeQL or Semgrep queries and run systematic code audits.

  • Score 85
  • 431 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install variant-analysis

Built from the published package, never by AI.

git clone --depth 1 https://github.com/CraftOS-dev/CraftBot /tmp/CraftBot && mkdir -p ~/.claude/skills && cp -r /tmp/CraftBot/skills/variant-analysis ~/.claude/skills/variant-analysis

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install variant-analysis in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The variant-analysis skill helps an AI assistant find vulnerabilities and bugs that are similar to one already identified in a codebase. It follows a five-step process: understand the root cause, write a pattern that matches only the known instance, identify which elements can be abstracted, generalize one change at a time, and then triage each match by location, confidence, exploitability and priority.

The skill recommends ripgrep for quick searches, Semgrep for simple pattern matching and taint tracking, and CodeQL for cross-function analysis. It includes starter templates for CodeQL and Semgrep in Python, JavaScript, Java, Go and C++, plus a report template. It is aimed at security analysts and developers doing systematic code audits after an initial issue has been found.

Written from the project's SKILL.md and checked against it.

What it can do

  • Exact match patternStarts with a search that matches only the known bug and checks it hits one location.
  • Iterative generalizationLoosens one element at a time and reviews new matches for false positives.
  • Abstraction guidanceExplains which elements to keep specific and which to replace with metavariables or wildcards.
  • Tool selectionMatches ripgrep, Semgrep or CodeQL to the scenario, such as quick search or cross-function analysis.
  • Match triageDocuments location, confidence, exploitability and priority for each match.
  • Pitfall checklistWarns about narrow search scope, overly specific patterns, single vulnerability classes and missing edge cases.
  • CodeQL and Semgrep templatesProvides starter query files for Python, JavaScript, Java, Go and C++.
  • Variant report templateProvides a report template for recording variant analysis results.

What you need

  • ripgrep
  • Semgrep
  • CodeQL

Try asking

  • Find variants of this auth check bug across the whole repository
  • Help me write a Semgrep rule for this unchecked null comparison
  • Draft a CodeQL query tracing user input into this exec call

Good to know

  • Not for initial vulnerability discovery; use audit-context-building or domain audits instead.
  • Not for general code review without a known pattern to search for.
  • Does not write fix recommendations; use issue-writer for that.
  • Stop generalizing when the false positive rate exceeds about 50%.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/variant-analysis/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • METHODOLOGY.md9 KB
  • SKILL.md6 KB
  • resources/codeql/cpp.ql3 KB
  • resources/codeql/go.ql2 KB
  • resources/codeql/java.ql2 KB
Show all 13 files
  • resources/codeql/javascript.ql2 KB
  • resources/codeql/python.ql2 KB
  • resources/semgrep/cpp.yaml3 KB
  • resources/semgrep/go.yaml2 KB
  • resources/semgrep/java.yaml2 KB
  • resources/semgrep/javascript.yaml2 KB
  • resources/semgrep/python.yaml2 KB
  • resources/variant-report-template.md1 KB

Alternatives to variant-analysis

All alternatives →

Compare with function_health, windows-privilege-escalation or github-actions-advanced

variant-analysis: common questions

What is variant analysis?

The skill searches for other instances of a bug after one has been found, by generalizing a pattern from the original root cause. It is meant for hunting bug variants across a codebase.

Which tools does variant-analysis use?

The skill uses ripgrep for quick searches, Semgrep for simple pattern matching and taint tracking, and CodeQL for cross-function analysis. It also provides query templates for CodeQL and Semgrep.

Which languages have templates?

The source lists CodeQL and Semgrep templates for Python, JavaScript, Java, Go and C++.

How do I install variant-analysis?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is variant-analysis free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is variant-analysis safe to use?

It scores 85 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 variant-analysis?

Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.

variant-analysis Install

Add to stack

Loading.