analyzing-experiment-query-performance

analyzing-experiment-query-performance is a skill for Claude Code, Codex from PostHog/posthog-foss. It costs 141 tokens per session (3,593 once invoked), scanned A, original, MIT.

A guide for reading production data about the speed and health of PostHog experiment queries, including precomputed results and cache storage.

In plain words
What is it for?
Use it to find slow experiment queries and inspect precomputation and cache health through the staff-only query-performance endpoints.
Why use it?
It provides a consistent way to investigate slow queries and distinguish problems that affect the US or EU production region.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to find slow experiment queries and inspect precomputation and cache health through the staff-only query-performance endpoints.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/posthog/posthog-foss/analyzing-experiment-query-performance
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.

Any agent
npx skills add PostHog/posthog-foss --skill analyzing-experiment-query-performance
Clone the repo
git clone --depth 1 https://github.com/PostHog/posthog-foss

Made for: Claude Code, Codex.

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 analyzing-experiment-query-performance

README.md
[![agentmods](https://agentmods.dev/badge/skills/posthog/posthog-foss/analyzing-experiment-query-performance/github.svg)](https://agentmods.dev/skills/posthog/posthog-foss/analyzing-experiment-query-performance)
Your own site
<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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyzing-experiment-query-performance

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,593 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00141 $0.03593
Opus 5.5 $0.00056 $0.01437
Sonnet 5.5 $0.00028 $0.00719
Haiku 4.5 $0.00014 $0.00359

Measured 2d ago against content hash fe3c97032f86, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2d 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}" \
.agents/skills/analyzing-experiment-query-performance/SKILL.md · 282 lines

How it starts

The opening of the file, as written. The whole thing — 282 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 a set of 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): products/experiments/frontend/scenes/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 an INTERNAL scope object, so the key must carry query_performance:read explicitly. 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)

Read the full file on GitHub · 282 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. 2d ago Changed fe3c97032f86
  2. 14d ago Changed · +6 lines c07b57ec262a
  3. 1mo ago Changed 4e691b977c3b
  4. 1mo ago Changed 0a4958786118
  5. 2mo ago Changed · +2 lines 1fb6d8611d91
  6. 2mo ago Changed · +5 lines cf8e4b479744
  7. 2mo ago Changed · +2 lines 5f1d05c25683
  8. 2mo ago Changed · +13 lines 97fa47ceee34
  9. 3mo ago First seen · 254 lines · 141 tokens per session scan A 410b81e97cf1

Subscribe to this mod's changes

analyzing-experiment-query-performance is a skill published in the GitHub repository PostHog/posthog-foss (736 stars, last pushed today), licensed MIT. It adds 141 tokens to every session and 3,593 once invoked, about $0.0006 per session on Opus 5.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.

Related

analyzing-experiment-query-performance compared with skills from other repositories

analyzing-experiment-query-performance next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
analyzing-experiment-query-performancePostHog/posthog-fossSkill736todayMITA141Claude Code, Codex
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill82ktodayMITA200Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill102ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill396ktodayMITA36Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15ktodayCC0-1.0A113Claude Code, Codex
systematic-debuggingobra/superpowersSkill332k6d agoMITA21Claude Code