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.
npx skills add PostHog/posthog-foss --skill analyzing-experiment-query-performancegit clone --depth 1 https://github.com/PostHog/posthog-fossWrote 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.
[](https://agentmods.dev/skills/posthog/posthog-foss/analyzing-experiment-query-performance)<a href="https://agentmods.dev/skills/posthog/posthog-foss/analyzing-experiment-query-performance"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/analyzing-experiment-query-performance.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00141 | $0.03085 |
| Opus 5 | $0.00071 | $0.01543 |
| Sonnet 5 | $0.00028 | $0.00617 |
| Haiku 4.5 | $0.00014 | $0.00309 |
Grade A, and why
analyzing-experiment-query-performance 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 7d ago.
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 -sf -H "Authorization: Bearer ${!pat_var}" \ How it starts
The opening of the file, as written. The whole thing — 254 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Analyzing experiment query performance
The /experiments/staff scene (staff-only UI, "Experiments staff tools") is backed by three GET endpoints
that are also callable directly with a personal API key.
They return the exact data the UI renders, sourced from ClickHouse query_log_archive
(experiment queries only, lc_product = 'experiments'), system.parts,
and the Postgres PreaggregationJob table.
Backend: posthog/api/debug_ch_queries.py (DebugCHQueries viewset).
Frontend types (authoritative response shapes): frontend/src/scenes/instance/QueryPerformance/queryPerformanceLogic.ts.
Environment
| Region | Base URL |
|---|---|
| US | https://us.posthog.com |
| EU | https://eu.posthog.com |
The regions are separate instances with separate data and separate keys. When the user doesn't specify a region, check both — a regression is often region-specific.
Authentication
Requests need a personal API key (PAT) from a staff account,
carrying the query_performance:read scope.
Two deliberate properties of this scope:
- A full-access (
*) PAT is rejected — the viewset is anINTERNALscope object, so the key must carryquery_performance:readexplicitly. Prefer a dedicated key with only this scope; it can read query-performance data and nothing else. - Every request is additionally gated on
is_staff, so a leaked key from a non-staff account is useless.
The scope is deliberately absent from the key-creation UI
(frontend/src/lib/scopes.tsx omits it as PAT-grantable only),
so the key must be created via the API.
Setup (once per region): the user, logged in to <base-url> as staff,
runs this in the browser devtools console:
await fetch('/api/personal_api_keys/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': document.cookie.match(/posthog_csrftoken=([^;]+)/)?.[1] ?? '',
},
body: JSON.stringify({
label: 'query-perf-agent',
scopes: ['query_performance:read'],
// required fields; empty = unrestricted (the endpoints are instance-level anyway)
scoped_teams: [],
scoped_organizations: [],
}),
}).then(async (r) => (await r.json()).value)
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.
- 7d ago First seen · 254 lines · 141 tokens per session scan A 410b81e97cf1
analyzing-experiment-query-performance is a skill published in the GitHub repository PostHog/posthog-foss (714 stars, last pushed today), licensed MIT. It adds 141 tokens to every session and 3,085 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-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…