variant-analysis — Claude Code skill: what it does, how to install
Finds related occurrences of an already identified defect across a repository. Use it after a vulnerability or logic issue turns up and similar code needs checking.
npx skills add trailofbits/skills --skill variant-analysis -a claude-codeWhat variant-analysis does
This skill starts from a known defect and looks for other code that shares its cause, including code outside the original module. It first forms a pattern that catches the reference case, then broadens one element at a time while reviewing every match.
Candidates are triaged with a severity assessment. The skill can turn a known issue into a CodeQL or Semgrep search, record failed patterns, and produce a CI rule aimed at preventing recurrence. Do not run it without a reference defect: initial vulnerability discovery is outside its job.
For a broad sweep, /variant-analysis:variants splits expansion directions across parallel subagents and repeats the search until it finds nothing new. The package includes CodeQL and Semgrep material for python, javascript, java, go, and cpp, plus a report template.
What it helps with
- find code paths that share a known defect cause
- build a CodeQL or Semgrep search from an identified issue
- filter noisy matches while broadening a pattern
- triage suspected variants with severity
- add a CI rule to prevent a defect from returning
Example prompts for the agent
- Find other occurrences of the defect we already identified in this project.
- Create a Semgrep search from the known issue and review the matches.
- `/variant-analysis:variants` sweep the project for variants of the known vulnerability.
How to install variant-analysis
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill variant-analysis -a claude-code2Manually: put the files in place
~/.claude/skills/variant-analysis/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/variant-analysis/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill variant-analysis -a codex2Manually: put the files in place
.agents/skills/variant-analysis/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill variant-analysis -a cursor2Manually: put the files in place
.cursor/skills/variant-analysis/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills variant-analysis2Manually: put the files in place
.github/skills/variant-analysis/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill variant-analysis -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/variant-analysis/skills/variant-analysisManually: put the files in place
.devin/skills/variant-analysis/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill variant-analysis -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set35
The whole set →Similar
Questions about variant-analysis
How do I install variant-analysis in Claude Code?
Run npx skills add trailofbits/skills --skill variant-analysis -a claude-code, then run npx skills add trailofbits/skills --skill variant-analysis -a claude-code again. After installation, use ~/.claude/skills/variant-analysis/SKILL.md.
What does variant-analysis do?
It searches a repository for defects that stem from the same cause as an issue already found. It moves from a reference match to broader patterns and helps assess the results.
When should I use variant-analysis?
Use it after finding a vulnerability, logic bug, or problematic coding pattern. It is not intended for an initial audit with no reference issue.