trace-sql

trace-sql is a skill for Claude Code, Codex from Generous-Corp/pulp. It costs 135 tokens per session (6,195 once invoked), scanned A, original, MIT.

A set of rules for querying Perfetto trace files with SQL. Perfetto is a tool that records timed events so developers can investigate performance and behaviour.

In plain words
What is it for?
It helps draft, validate, and run queries over Pulp trace files, find events by stable identifiers, handle incomplete durations, and join related spans.
Why use it?
Trace queries can silently give incomplete or wrong results when they mishandle unfinished events, patterns, joins, or repeated view creation.

Skill for Claude CodeCodex

Part of the pulp plugin — 63 skills, 30 commands, 3 hooks, 1 MCP server shipped together

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/generous-corp/pulp/trace-sql
Any agent
npx skills add Generous-Corp/pulp --skill trace-sql
Clone the repo
git clone --depth 1 https://github.com/Generous-Corp/pulp

Made for: Claude Code, Codex.

Or install pulp, the plugin that ships this one along with the rest of its 63 skills, 30 commands, 3 hooks, 1 MCP server.

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 trace-sql

README.md
[![agentmods](https://agentmods.dev/badge/skills/generous-corp/pulp/trace-sql.svg)](https://agentmods.dev/skills/generous-corp/pulp/trace-sql)
Your own site
<a href="https://agentmods.dev/skills/generous-corp/pulp/trace-sql"><img src="https://agentmods.dev/badge/skills/generous-corp/pulp/trace-sql.svg" alt="Measured on agentmods" height="20"></a>
Per session 135 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,195 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 $0.00135 $0.06195
Opus 5 $0.00068 $0.03097
Sonnet 5 $0.00027 $0.01239
Haiku 4.5 $0.00014 $0.00619

Measured today against content hash 4e4d93b3b4b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

trace-sql 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 today.

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.

`curl -sSL -o trace_processor https://get.perfetto.dev/trace_processor` which
.agents/skills/trace-sql/SKILL.md · 460 lines

How it starts

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

trace-sql — querying Pulp traces with trace_processor

Pulp's tracing subsystem writes Perfetto .pftrace files; this skill is the SQL discipline for turning one into an answer. It is the query substrate under the trace-analysis harness and under pulp trace query / pulp trace <preset>. You are reading this because you are writing SQL over a .pftrace, a query came back empty or wrong, or the investigation harness needs a named primitive to query.

This skill is provider-agnostic by construction: it is a plain SKILL.md read identically by Claude Code and Codex from .agents/skills/. Nothing here depends on a specific agent, MCP server, or vendor.

Attribution. The SQL discipline below (the draft→validate→execute loop, GLOB-over-LIKE, incomplete-slice handling, stable-key joins, SPAN_JOIN guidance) is adapted from Google's android/skills perfetto-sql (Apache-2.0). The methodology is reused; the Android domain content (SurfaceFlinger, binder, ftrace, cpu governor) is not — every query here is authored against Pulp's own category taxonomy. See NOTICE.md.


The tool: trace_processor

Queries run through the trace_processor wrapper (a small Python launcher that resolves the precompiled trace_processor_shell binary). SQL is strictly offline: pulp trace query requires --trace FILE.pftrace and shells to trace_processor; it never forwards SQL to a live inspector:

# Offline SQL against a saved capture (no live inspector needed):
pulp trace query "SELECT name, dur FROM slice ORDER BY dur DESC LIMIT 20" \
  --trace /tmp/pulp-<ts>.pftrace

Pulp resolves the binary via $PULP_TRACE_PROCESSOR → the pinned Pulp-fetched build → $PATH; pulp trace doctor reports which. For zero-install, run pulp trace fetch once: it downloads the pinned trace_processor_shell (Perfetto v57.2, matching the tracing SDK), SHA-256-verified per platform, into $PULP_HOME — no manual install, no surprise download inside query. trace_processor is also a first-class entry in Pulp's tool registry, so pulp tool install trace-processor (and pulp tool info/doctor trace-processor) fetch the identical pinned artifact — same code path as pulp trace fetch. To drive trace_processor directly:

Read the full file on GitHub · 460 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today First seen · 460 lines · 135 tokens per session scan A 4e4d93b3b4b7

Subscribe to this mod's changes

trace-sql is a skill published in the GitHub repository Generous-Corp/pulp (16 stars, last pushed today), licensed MIT. It adds 135 tokens to every session and 6,195 once invoked, about $0.0007 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-04.

Related

Other skills, from other repositories

schema-exploration

Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate.

langchain-ai/deepagents · 57 tokens

debugging

How to debug tursodb using Bytecode comparison, logging, ThreadSanitizer, deterministic simulation, and corruption analysis tools.

tursodatabase/turso · 28 tokens

sdk-design

Doctrine for designing and evolving any SDK Grida ships — TypeScript, Rust, or otherwise. "SDK" here means a surface that crosses a foreign-or-foreign-treated boundary: published packages, separately-versioned consumers, FFI bindings, public-by-design modules. An SDK's job is to refuse; a strict, honest surface…

gridaco/grida · 199 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens

supabase

Supabase / PostgREST Row-Level-Security playbook — pull the anon (or leaked servicerole) key out of the frontend JS, map tables from the auto-generated OpenAPI spec, test anonymous RLS READ disclosures (PII/secret leaks), and anonymous RLS WRITE abuse (insert/update/delete — e.g. forging…

PentesterFlow/agent · 120 tokens

nornicdb-cypher-queries

Pick fast, predictable Cypher query shapes in NornicDB — point lookups, batch retrieval, pagination, search, traversal, batched UNWIND/MERGE writes, cleanup, multi-tenant isolation. Use when writing or reviewing Cypher whose latency or throughput matters; maps user intent to the executor's hot-path query templates.

orneryd/NornicDB · 79 tokens