/auditing-endpoints
Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions. Use when the user asks "what endpoints can I clean up?", "are any of my endpoints broken?", "which materialised versions are still being called?", or wants a
$ npx -y skills add posthog/posthog --skill auditing-endpoints --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/auditing-endpoints
Context preview
The summary Claude sees to decide when to auto-load this skill.
Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions. Use when the user asks "what endpoints can I clean up?", "are any of my endpoints broken?", "which materialised versions are still being called?", or wants a
SKILL.md
auditing-endpoints.SKILL.mdname: auditing-endpoints
description: >
Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused
materialised versions. Use when the user asks "what endpoints can I clean up?", "are any of my
endpoints broken?", "which materialised versions are still being called?", or wants a one-shot
cleanup pass over the Endpoints product. Produces a prioritised report grouped by issue type, with
recommended actions but does not modify anything without explicit confirmation.
Auditing endpoints
This skill produces a project-wide audit of the Endpoints product. Use it when the user wants to **find what to clean up** — unused endpoints, failing materialisations, materialised versions that nobody calls any more. It does not modify anything; it reports.
The deeper investigation per endpoint is `diagnosing-endpoint-performance`. The audit's job is to find candidates and hand off.
When to use this skill
- "Audit my endpoints" / "What endpoints can I clean up?"
- The user is taking over a project and wants to know what they've inherited
- A periodic review (monthly / quarterly) of endpoint sprawl
- The user is over a materialisation cost budget and wants to know what to disable
The dedicated tools give a fast endpoint-level view. For call frequency, recency, and cost over time, query the `query_log` table with `execute-sql` (endpoint-level). Per-version recency comes from `endpoint-versions` — each version carries its own `last_executed_at`.
Available tools
| Tool | What it's for | | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `execute-sql` (HogQL) | **Primary read path.** Query `system.data_modeling_endpoints` for metadata (name, is_active, current_version, derived_from_insight, last_executed_at) and `query_log` for endpoint-level usage (call counts, recency, duration, bytes) | | `endpoint-materialization-status` | Per endpoint: is materialisation eligible, current status, last run, last error (not in the system tables — use this tool) | | `endpoint-versions` | All versions for one endpoint, latest first, with each version's query, materialisation state, and `last_executed_at` | | `endpoint-update` | Write path — disable (`is_active: false`) or unmaterialise (`is_materialized: false`) after the user confirms | | `agent-feedback` | Tell the PostHog team what's missing or confusing in this flow so the product and skill improve |
Prefer reading from the system tables over the `endpoints-get-all` / `endpoint-get` tools — one SQL query returns the whole inventory and lets you join metadata to usage in `query_log`.
What counts as an issue
| Category | Trigger | Typical action | | ------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------- | | **Never called** | No rows in `query_log` for the endpoint (personal-API-key calls only) | Confirm with the user, then disable | | **Stale** | `query_log` shows the last call more than 30 days ago | Confirm with the user; often safe to disable | | **Inactive** | `is_active = 0` in `system.data_modeling_endpoints` | Verify intent; if abandoned, delete | | **Failing materialisation** | `endpoint-materialization-status` returns `Failed` with an error | Hand off to `diagnosing-endpoint-performance` | | **Unused materialised version** | A materialised version whose `last_executed_at` (from `endpoint-versions`) is null or long stale | Unmaterialise that version, or roll to a newer one | | **Drifted versions** | Many versions exist (query changed repeatedly) | History noise — not an issue, but worth noting |
Usage counts only **personal-API-key calls** — an endpoint exercised solely from the Playground tab or the app will look unused. Per-version `last_executed_at` is recorded only for runs since that tracking was added, so a version can read null while still being used; always confirm before removing.
Workflow
1. List endpoints and their metadata
One `execute-sql` query gets the whole inventory from `system.data_modeling_endpoints`:
SELECT name, is_active, current_version, derived_from_insight, last_executed_at
FROM system.data_modeling_endpoints
ORDER BY name
No rows → the project has no endpoints; say so and stop. Don't invent issues. (The `last_executed_at` column here is a convenience endpoint-level timestamp; for call frequency and cost, use `query_log` in the next step.)
2. Pull usage from `query_log`
`query_
Read more
name: auditing-endpoints description: > Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions. Use when the user asks "what endpoints can I clean up?", "are any of my endpoints broken?", "which materialised versions are still being called?", or wants a one-shot cleanup pass over the Endpoints product. Produces a prioritised report grouped by issue type, with recommended actions but does not modify anything without explicit confirmation.
Auditing endpoints
This skill produces a project-wide audit of the Endpoints product. Use it when the user wants to **find what to clean up** — unused endpoints, failing materialisations, materialised versions that nobody calls any more. It does not modify anything; it reports.
The deeper investigation per endpoint is `diagnosing-endpoint-performance`. The audit's job is to find candidates and hand off.
When to use this skill
- "Audit my endpoints" / "What endpoints can I clean up?"
- The user is taking over a project and wants to know what they've inherited
- A periodic review (monthly / quarterly) of endpoint sprawl
- The user is over a materialisation cost budget and wants to know what to disable
The dedicated tools give a fast endpoint-level view. For call frequency, recency, and cost over time, query the `query_log` table with `execute-sql` (endpoint-level). Per-version recency comes from `endpoint-versions` — each version carries its own `last_executed_at`.
Available tools
| Tool | What it's for | | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `execute-sql` (HogQL) | **Primary read path.** Query `system.data_modeling_endpoints` for metadata (name, is_active, current_version, derived_from_insight, last_executed_at) and `query_log` for endpoint-level usage (call counts, recency, duration, bytes) | | `endpoint-materialization-status` | Per endpoint: is materialisation eligible, current status, last run, last error (not in the system tables — use this tool) | | `endpoint-versions` | All versions for one endpoint, latest first, with each version's query, materialisation state, and `last_executed_at` | | `endpoint-update` | Write path — disable (`is_active: false`) or unmaterialise (`is_materialized: false`) after the user confirms | | `agent-feedback` | Tell the PostHog team what's missing or confusing in this flow so the product and skill improve |
Prefer reading from the system tables over the `endpoints-get-all` / `endpoint-get` tools — one SQL query returns the whole inventory and lets you join metadata to usage in `query_log`.
What counts as an issue
| Category | Trigger | Typical action | | ------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------- | | **Never called** | No rows in `query_log` for the endpoint (personal-API-key calls only) | Confirm with the user, then disable | | **Stale** | `query_log` shows the last call more than 30 days ago | Confirm with the user; often safe to disable | | **Inactive** | `is_active = 0` in `system.data_modeling_endpoints` | Verify intent; if abandoned, delete | | **Failing materialisation** | `endpoint-materialization-status` returns `Failed` with an error | Hand off to `diagnosing-endpoint-performance` | | **Unused materialised version** | A materialised version whose `last_executed_at` (from `endpoint-versions`) is null or long stale | Unmaterialise that version, or roll to a newer one | | **Drifted versions** | Many versions exist (query changed repeatedly) | History noise — not an issue, but worth noting |
Usage counts only **personal-API-key calls** — an endpoint exercised solely from the Playground tab or the app will look unused. Per-version `last_executed_at` is recorded only for runs since that tracking was added, so a version can read null while still being used; always confirm before removing.
Workflow
1. List endpoints and their metadata
One `execute-sql` query gets the whole inventory from `system.data_modeling_endpoints`:
SELECT name, is_active, current_version, derived_from_insight, last_executed_at FROM system.data_modeling_endpoints ORDER BY name
No rows → the project has no endpoints; say so and stop. Don't invent issues. (The `last_executed_at` column here is a convenience endpoint-level timestamp; for call frequency and cost, use `query_log` in the next step.)
2. Pull usage from `query_log`
`query_
:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Repo: posthog/posthog
Other skills on posthog.
- /analyzing-expensive-users
Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.
Open skill - /creating-online-evaluations
Author continuously-running online evaluations in PostHog AI observability, grounded in real failure modes you've identified. Use when the user wants evaluations that automatically score new generations or whole traces going forward — "create an eval to catch X", "continuously
Open skill - /exploring-ai-failures
Find where an AI/LLM application is failing in production and surface the failure patterns, working from real traces. Use when someone wants to understand what's going wrong with an AI feature, find and categorize failure modes, triage errors, or investigate quality issues
Open skill - /exploring-llm-clusters
Investigate AI observability clusters — understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into individual traces within clusters.
Open skill - /exploring-llm-costs
Investigate LLM spend in PostHog — total cost over time, cost by model, provider, user, trace, or custom dimension, token and cache-hit economics, and cost regressions. Use when the user asks "how much are we spending on LLMs?", "which model / user / feature is most expensive?",
Open skill - /exploring-llm-evaluations
Investigate AI observability evaluations — `hog` (deterministic code-based), `llm_judge` (LLM-prompt-based), and `sentiment` (user-message sentiment). Find existing evaluations, inspect their configuration, run them against specific generations, query individual results, and
Open skill

