Back to Skills

codeql

Comprehensive guide for setting up and configuring CodeQL code scanning via GitHub Actions workflows and the CodeQL CLI. This skill should be used when users need help with code scanning configuration, CodeQL workflow files, CodeQL CLI commands, SARIF output, security analysis setup, or troubleshooting CodeQL analysis.

35,539stars4,385forksUpdated 6/23/2026

Security Assessment

Low Risk(80/100)

Detected risks:

Privilege Escalation([references/compiled-languages.md] sudo)
Security Score80/100

About codeql

The codeql skill provides procedural guidance for setting up and configuring CodeQL code scanning, both through GitHub Actions workflows and the standalone CodeQL CLI. It helps users create or customize scanning configuration, interpret SARIF output, and troubleshoot analysis failures for security analysis.

For GitHub Actions, it walks through choosing default versus advanced setup, configuring triggers, least-privilege permissions, a per-language build matrix with appropriate build modes (none, autobuild, manual), the init and analyze steps, query suite selection (security-extended, security-and-quality, custom packs), dependency caching, and monorepo configuration via categories and config files. For the CLI, it covers installing the CodeQL bundle, creating single- or multi-language databases, analyzing with query suites to SARIF, and uploading results to GitHub. It also explains the two alert severity dimensions and Copilot Autofix.

It is most useful for developers and security engineers configuring code scanning across the supported languages (C/C++, C#, Go, Java/Kotlin, JavaScript/TypeScript, Python, Ruby, Rust, Swift, and GitHub Actions), whether in CI or locally.

FAQ

When should I use this skill?

When configuring CodeQL code scanning: creating workflow files, choosing build modes or query suites, running the CodeQL CLI, interpreting SARIF, or troubleshooting analysis failures.

Default setup or advanced setup?

Default setup enables scanning quickly from repository settings; advanced setup uses a .github/workflows/codeql.yml file for full control over triggers, build modes, query suites, and matrices.

Which languages are supported?

C/C++, C#, Go, Java/Kotlin, JavaScript/TypeScript, Python, Ruby, Rust, Swift, and GitHub Actions.

How do I run CodeQL locally?

Install the CodeQL bundle, run database create (single or with --db-cluster), database analyze to SARIF, and github upload-results (which needs a token with security-events: write).

How are alerts prioritized?

By two severity dimensions: standard severity (Error/Warning/Note) and security severity (Critical/High/Medium/Low from CVSS), with security severity taking display precedence; Copilot Autofix can suggest fixes in PRs.

All Files

7 files
references/sarif-output.md9.6 KB
View
references/compiled-languages.md9.1 KB
View
SKILL.md13.1 KB
View
references/alert-management.md6.3 KB
View
references/troubleshooting.md8.9 KB
View
references/cli-commands.md8.1 KB
View
references/workflow-configuration.md8.4 KB
View

Install codeql

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill