codeql-expert

codeql-expert is a skill for Claude Code from personamanagmentlayer/pcl. It costs 68 tokens per session (1,480 once invoked), scanned A, original, Apache-2.0.

A guide to CodeQL, a tool that treats source code as searchable data so developers can write queries to find vulnerabilities, bugs, and coding patterns. It supports several languages and can run in CI/CD, the automated build and delivery pipeline.

In plain words
What is it for?
Use it to create CodeQL databases, write custom queries, scan supported languages, review findings, detect vulnerabilities, and add code scanning to CI/CD.
Why use it?
It helps teams find security and quality problems across a codebase using repeatable analysis. Running checks in CI/CD can catch issues before code is released.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/personamanagmentlayer/pcl/codeql-expert
Any agent
npx skills add personamanagmentlayer/pcl --skill codeql-expert
Clone the repo
git clone --depth 1 https://github.com/personamanagmentlayer/pcl

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codeql-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/codeql-expert.svg)](https://agentmods.dev/skills/personamanagmentlayer/pcl/codeql-expert)
Your own site
<a href="https://agentmods.dev/skills/personamanagmentlayer/pcl/codeql-expert"><img src="https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/codeql-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,480 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.01480
Opus 5 $0.00034 $0.00740
Sonnet 5 $0.00014 $0.00296
Haiku 4.5 $0.00007 $0.00148

Measured yesterday against content hash d62c049fafdc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

codeql-expert scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

wget https://github.com/github/codeql-cli-binaries/releases/latest/download/codeql-linux64.zip
stdlib/security/codeql-expert/SKILL.md · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CodeQL Expert

Expert guidance for CodeQL static analysis, custom query development, vulnerability detection, and integration with CI/CD pipelines.

Core Concepts

CodeQL Overview

  • Semantic code analysis engine
  • Treats code as data (queryable database)
  • Supports C/C++, C#, Go, Java, JavaScript/TypeScript, Python, Ruby
  • Powers GitHub Code Scanning
  • Custom query development with QL language

CodeQL Workflow

  1. Extract code to database
  2. Write QL queries
  3. Run analysis
  4. Review results
  5. Fix vulnerabilities
  6. Integrate into CI/CD

Query Types

  • Security queries (vulnerabilities)
  • Code quality queries (bugs, code smells)
  • Compliance queries (coding standards)
  • Custom queries (org-specific patterns)

Installation & Setup

# Download CodeQL CLI
wget https://github.com/github/codeql-cli-binaries/releases/latest/download/codeql-linux64.zip
unzip codeql-linux64.zip
export PATH="$PATH:/path/to/codeql"

# Clone CodeQL queries
git clone https://github.com/github/codeql.git codeql-repo

# Verify
codeql --version

Create Database

# JavaScript/TypeScript
codeql database create my-js-db --language=javascript

# Java (requires build)
codeql database create my-java-db \
  --language=java \
  --command="mvn clean package"

# Python
codeql database create my-python-db --language=python

# Multiple languages
codeql database create my-db --db-cluster --language=javascript,python

Writing CodeQL Queries

Basic Query Structure

/**
 * @name SQL Injection
 * @description Detects SQL injection vulnerabilities
 * @kind path-problem
 * @problem.severity error
 * @security-severity 9.8
 * @precision high
 * @id js/sql-injection
 * @tags security external/cwe/cwe-089
 */

import javascript
import semmle.javascript.security.dataflow.SqlInjectionQuery
import DataFlow::PathGraph

from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
where cfg.hasFlowPath(source, sink)
select sink.getNode(), source, sink,
  "SQL query depends on $@.", source.getNode(), "user input"

Read the full file on GitHub · 251 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +7 lines · +48 tokens per session d62c049fafdc
  2. 2d ago First seen · 244 lines · 20 tokens per session scan A b33c251a7f4e

Subscribe to this mod's changes

codeql-expert is a skill published in the GitHub repository personamanagmentlayer/pcl (41 stars, last pushed yesterday), licensed Apache-2.0. It adds 68 tokens to every session and 1,480 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.