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 profiling-slow-api-endpointsgit 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/profiling-slow-api-endpoints)<a href="https://agentmods.dev/skills/posthog/posthog-foss/profiling-slow-api-endpoints"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/profiling-slow-api-endpoints/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.
<a href="https://agentmods.dev/skills/posthog/posthog-foss/profiling-slow-api-endpoints"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/profiling-slow-api-endpoints.svg" alt="Reviewed on agentmods" width="80" 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.00113 | $0.00874 |
| Opus 5.5 | $0.00045 | $0.00350 |
| Sonnet 5.5 | $0.00023 | $0.00175 |
| Haiku 4.5 | $0.00011 | $0.00087 |
Grade A, and why
profiling-slow-api-endpoints scanned grade A with 0 findings 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 2mo 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Profiling slow API endpoints
Use this skill when a PostHog API request spends most of its time in Postgres or Python.
For ClickHouse and HogQL, use
optimizing-clickhouse-and-hogql-queries.
Measure the same user action before and after the change. A faster query does not help if the action stays slow.
Find the source of the delay
Record the page action, endpoint, request shape, affected users, request volume, and a latency percentile such as p95.
Read slow APM traces with posthog:query-apm-spans and the exploring-apm-traces skill.
The distribution shows how often requests are slow.
The traces show where they spend time.
- Django ORM and
cursor.executespans point to Postgres. - ClickHouse work belongs in the ClickHouse skill.
- Time outside database spans can indicate repeated calls, serialization, or excess data loading.
Follow the request to the function that creates the work. Do not optimize a view wrapper when another function owns the delay.
Capture the exact work
Get the SQL and parameters from a slow request. Keep its filters, ordering, and page size. Check for repeated queries, count queries, and work that does not block the response. A reduced query can use a different plan. Local data and statistics can also produce a different plan.
Use
querying-production-databases-via-metabase
to inspect the production read replica.
Start with EXPLAIN.
Use EXPLAIN (ANALYZE, BUFFERS) only when the exact SELECT is safe to run.
Inspect row estimates, indexes, join types, loops, filters, sorts, and buffer use.
Compare the smallest useful change
Remove work that the response does not need before you change a query or add an index. Compare the original and candidate with the same parameters. Run each more than once, record the cache state, and verify equal results.
Measure the tenant-size distribution when plans can change with tenant size. Test both sides of a plan crossover before you select a threshold. One tenant is not enough evidence for a conditional plan.
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.
- 2mo ago First seen · 92 lines · 113 tokens per session scan A 34d3f567877f
profiling-slow-api-endpoints is a skill published in the GitHub repository PostHog/posthog-foss (736 stars, last pushed today), licensed MIT. It adds 113 tokens to every session and 874 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.
profiling-slow-api-endpoints compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| profiling-slow-api-endpointsPostHog/posthog-foss | Skill | 736 | today | MIT | A | 113 | Claude Code, Codex |
| systematic-debuggingopen-metadata/OpenMetadata | Skill | 16k | today | Apache-2.0 | A | 37 | Claude Code |
| log-error-digestzebbern/claude-code-guide | Skill | 4.7k | today | MIT | A | 71 | Claude Code, Codex |
| observability-audit-sessionsIBM/mcp-context-forge | Skill | 4.9k | today | Apache-2.0 | A | 64 | Claude Code, Codex |
| cwv-optimizeradobe/skills | Skill | 343 | today | Apache-2.0 | A | 112 | Claude Code |
| performance-verificationvalkor-ai/loom | Skill | 1.6k | 2d ago | Apache-2.0 | A | 45 | Claude Code, Codex |
| loop-engineeringhuytieu/COG-second-brain | Skill | 1.6k | today | MIT | A | 63 | Claude Code |