codeql
CodeQL deep static analysis with dataflow validation
Install / Use
npx skills add gadievron/raptorInstalls into whichever agent you are using.
Claude Commands
Claude Code slash commands
Quality Score
Category
Development & EngineeringSupported Platforms
Skill content
View source on GitHubdescription: CodeQL deep static analysis with dataflow validation dispatch: python3 raptor.py codeql
/codeql - RAPTOR CodeQL Analysis
--help / -h: If the user passes only --help or -h, run python3 raptor.py codeql --help and present its output. That command is side-effect-free (no run, lifecycle, output directory, or LLM dispatcher) and is the complete, authoritative flag list — do NOT start a scan or hand-summarise flags from this doc.
Runs CodeQL deep static analysis with dataflow validation. Slower but finds complex vulnerabilities that Semgrep misses (tainted flows, use-after-free, injection chains).
Usage
python3 raptor.py codeql --repo <path> [options]
Options
| Option | Description |
|--------|-------------|
| --repo <path> | Repository path (required) |
| --languages <list> | Comma-separated languages (auto-detected if omitted) |
| --scan-only | Scan only — produce SARIF, skip LLM analysis (default) |
| --analyze | Enable LLM-powered autonomous analysis + exploit generation |
| --build-command <cmd> | Custom build command for database creation |
| --extended | Use extended security suites (more rules, slower) |
| --force | Force database recreation |
| --max-findings <n> | Max findings to analyse (with --analyze) |
| --project <name> | Pin the run to a named project (or - for explicitly projectless). Wins over the session binding and the last-activated default; invalid names are a hard error, never a fallback. |
SMT Dataflow Pre-Check
When --analyze is enabled, dataflow findings are routed through an SMT
pre-check before the full LLM analysis (core/smt_solver/path_feasibility.py,
driven from packages/codeql/dataflow_validator.py):
- The LLM extracts branch conditions from each path step as structured predicates
(
"size > 0","offset + length <= buffer_size", etc.) - Z3 checks whether those conditions are jointly satisfiable
- unsat → path is provably unreachable; finding marked non-exploitable without the full analysis LLM call (confidence capped at 0.7)
- sat → concrete satisfying values returned; fed as candidate inputs into the
LLM prompt and
prerequisitesfield ofDataflowValidation - None → Z3 unavailable or conditions unparseable; full LLM analysis runs
Requires z3-solver (pip install z3-solver). Degrades gracefully when absent.
Best coverage: CWE-190 (integer overflow, including 32-bit wraparound — the extraction LLM emits per-path width/signedness hints so Z3 models the right C type semantics), CWE-120/122 (buffer size checks), CWE-193 (off-by-one), CWE-476 (null deref). String-based findings (CWE-89) fall through to LLM analysis.
Trust escalation on degraded builds (interactive sessions only)
Two run-output hints mark places where a trust decision — not a retry — is what
unblocks better results. After the run completes (never mid-pipeline), offer the
decision as a structured choice (see CLAUDE.md § INTERACTIVE PROMPTS). Run
libexec/raptor-may-ask first; only if it prints interactive AND the
AskUserQuestion tool is available, ask. Quote the actual hint text from the run
output in the question.
Trigger A — buildless extraction hit unresolved includes (output contains "build-generated headers are invisible without a traced build (opt in via --traced-build)"):
- Keep buildless (Recommended) — accept the results as-is; TUs needing build-generated headers stay partially analysed. No repo code is executed.
- Re-run with
--traced-build— grants for that one run: CodeQL executes the repo's build system (attacker-controlled build scripts from the scanned repo) to extract with full build context. - Persist
/project trust build— grants: every future/codeqland/agenticrun on this project does traced-build extraction (per-run--no-traced-buildstill overrides).builddoes NOT implyconfig.
Trigger B — strict trust checks skipped an LLM-assisted step (output warns the target repo has dangerous Claude Code config and says "Pass --trust-repo to override"):
- Keep strict (Recommended) — the run stands; repo-provided Claude Code / CodeQL configuration stays quarantined.
- Re-run with
--trust-repo— grants for that one run: lifts the cc_trust + codeql_trust strict checks, so repo-provided Claude Code config and CodeQL packs/configs are honoured. - Persist
/project trust config— grants: the--trust-repoumbrella (cc_trust + codeql_trust) on every future run of this project (per-run--no-trust-repostill overrides).
Non-interactive fallback (both triggers): current behavior — proceed with the degraded results and surface the hint text plus the flag / trust-marker escape hatches in the run summary. Never set a trust marker or add a trust flag without an explicit operator selection.
Examples
# Scan only (default) — produces SARIF
/codeql --repo /tmp/vulns
# Full autonomous analysis (includes SMT dataflow pre-check if z3 installed)
/codeql --repo /tmp/vulns --analyze
# Specific language with custom build
/codeql --repo /tmp/vulns --languages cpp --build-command "make"
Related Skills
pyspark-etl-best-practices-cursorrules-prompt-file
40.7kCursor rules for PySpark ETL development with code style, joins, window functions, map operations, and Iceberg patterns.
claude-mem
91.8kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Understand-Anything
80.4kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
Agent-Reach
75.0kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Security Score
Audited on Aug 25, 2026
