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,085 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…

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.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.svg" alt="Measured on agentmods" 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,085 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.
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.03085
Opus 5 $0.00071 $0.01543
Sonnet 5 $0.00028 $0.00617
Haiku 4.5 $0.00014 $0.00309

Measured 7d ago against content hash 410b81e97cf1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 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}" \
.agents/skills/analyzing-experiment-query-performance/SKILL.md · 254 lines

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 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 · 254 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. 7d 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 (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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

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…

microsoft/ai-agents-for-beginners · 200 tokens

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…

vercel/next.js · 95 tokens

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.

microsoft/vscode · 53 tokens

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…

microsoft/vscode · 71 tokens

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…

vercel/next.js · 83 tokens