codeql
Skill by trailofbits
Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking. Aimed at developers who want SAST results across several languages.
Install codeql
Built from the published package, never by AI.
git clone --depth 1 https://github.com/trailofbits/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/plugins/static-analysis/skills/codeql ~/.claude/skills/codeqlRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/trailofbits/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/plugins/static-analysis/skills/codeql ~/.gemini/antigravity-cli/skills/codeqlAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill runs CodeQL static analysis to find security vulnerabilities in a codebase. It covers Python, JavaScript and TypeScript, Go, Java and Kotlin, C and C++, C#, Ruby, and Swift. It works through three workflows: building a CodeQL database, creating data extension models for project-specific sources and sinks, and running the analysis.
The skill supports a "run all" mode, which combines the security-and-quality and security-experimental suites, and an "important only" mode that uses high-precision queries. It checks database quality and query suite validity, and it writes all output to a single directory. It is intended for developers and security reviewers who want a CodeQL scan of their own repository.
Written from the project's SKILL.md and checked against it.
What it can do
- Build CodeQL databaseCreates a CodeQL database for the codebase, trying build methods in sequence.
- Create data extensionsDetects or generates data extension models for project-specific sources and sinks.
- Run analysisRuns CodeQL queries in "run all" or "important only" mode and writes SARIF results.
- Check database qualityRuns a script that checks the database after the build for extraction problems.
- Verify query suiteRuns a script that checks the query suite in use before analysis results are reported.
What you need
- CodeQL CLI on PATH
- jq
- uv
- A build environment for compiled languages
Try asking
- Run CodeQL on this repo and report important findings only
- Build a CodeQL database for this Python project
- Create CodeQL data extensions for our internal database wrapper
Good to know
- Compiled languages need a working build, and build-mode=none gives incomplete analysis.
- On macOS Apple Silicon, some compiled-language builds need a workaround.
- For fast single-file pattern matching or when no build is available, the source points to the semgrep skill instead.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: plugins/static-analysis/skills/codeql/SKILL.md, plugins/static-analysis/skills/codeql/scripts/build_log.sh, plugins/static-analysis/skills/codeql/scripts/check_db_quality.py, plugins/static-analysis/skills/codeql/scripts/find_databases.sh, plugins/static-analysis/skills/codeql/scripts/generate_suite.sh, plugins/static-analysis/skills/codeql/scripts/test_build_log.py, plugins/static-analysis/skills/codeql/scripts/test_build_mode_claims.py, plugins/static-analysis/skills/codeql/scripts/test_check_db_quality.py, plugins/static-analysis/skills/codeql/scripts/test_find_databases.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: Bash Read Write Edit Glob Grep AskUserQuestion TaskCreate TaskList TaskUpdate TaskGet
-
SKILL.md18 KB -
agents/openai.yaml239 B -
assets/trail-of-bits-mark.svg3 KB -
references/build-fixes.md3 KB -
references/diagnostic-query-templates.md10 KB
Show all 34 files
-
references/extension-yaml-format.md7 KB -
references/important-only-suite.md5 KB -
references/language-details.md6 KB -
references/macos-arm64e-workaround.md7 KB -
references/performance-tuning.md3 KB -
references/quality-assessment.md8 KB -
references/ruleset-catalog.md2 KB -
references/run-all-suite.md5 KB -
references/sarif-processing.md3 KB -
references/threat-models.md3 KB -
scripts/build_log.sh2 KB -
scripts/check_db_quality.py15 KB -
scripts/find_databases.sh2 KB -
scripts/generate_suite.sh3 KB -
scripts/pyproject.toml585 B -
scripts/test_build_log.py3 KB -
scripts/test_build_mode_claims.py4 KB -
scripts/test_check_db_quality.py20 KB -
scripts/test_find_databases.py6 KB -
scripts/test_generation_scripts.py12 KB -
scripts/test_script_flags.py6 KB -
scripts/test_section_pointers.py8 KB -
scripts/test_shell_blocks.py29 KB -
scripts/test_suite_templates.py5 KB -
scripts/test_verify_query_suite.py2 KB
And 4 more files on GitHub.
Alternatives to codeql
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
codeql: common questions
Which languages does the CodeQL skill support?
The source lists Python, JavaScript and TypeScript, Go, Java and Kotlin, C and C++, C#, Ruby, and Swift.
What is the difference between run all and important only?
Run all uses the security-and-quality and security-experimental suites. Important only uses high-precision queries.
When should I use semgrep or sarif-parsing instead?
The source says to use the semgrep skill for fast single-file pattern matching or when no build is available for a compiled language. It says to use the sarif-parsing skill to parse SARIF that already exists.
How do I install codeql?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is codeql free?
The code is published under the CC-BY-SA-4.0 licence. The service it connects to may have its own pricing.
Is codeql safe to use?
It scores 92 of 100. Grades: maintenance A, licence C, quality A. 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 codeql?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
