auditing-endpoints
Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions.
Skill by PostHogOfficial
Chalk Labs
Need help deploying auditing-endpoints?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/posthog-auditing-endpoints-fcc8d2
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill 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.
- License
- MIT
- Instructions
- 202 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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`: ```sql 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_log` records every personal-API-key call, tagged with the endpoint name. One query gives recency and call counts across all endpoints: ```sql SELECT name, count() AS calls, max(query_start_time) AS last_called FROM query_log WHERE endpoint LIKE '%/endpoints/%' AND is_personal_api_key_request GROUP BY name ORDER BY name ``` Cross-reference with step 1: - **In metadata, absent from `query_log`** → never called via API key - **Last call more than 30 days ago** → stale `query_log` also exposes `query_duration_ms`, `read_rows`, and `read_bytes` per call — useful to flag expensive endpoints in the same pass. This is endpoint-level; per-version recency comes from `endpoint-versions` (step 3). ### 3. Check materialisation health and unused versions For each materialised endpoint, call `endpoint-materialization-status` (this isn't in the system tables). Surface any with `status: "Failed"` separately — these are active failures, not staleness. Then call `endpoint-versions` and read each version's `last_executed_at`: a **materialised** version that's null or long stale is an unused-materialised-version candidate. Treat this as a lead, not proof — per-version recency only counts API-key runs since tracking was added, so confirm with the user before unmaterialising. ### 4. Present the audit Render a prioritised report grouped by category. Don't dump raw JSON; use a readable table per section: ```text ## Endpoints audit — 9 issues ### 🔴 Failing materialisations (1) - weekly_revenue (v3) — Failed 2h ago, "Column 'event_date' does not exist" → hand off to diagnosing-endpoint-performance ### 🟠 Never called via API key (3) - internal_admin_query — created 5 months ago - legacy_signup_funnel — created 1 year ago, materialised - experiment_arm_lookup — created 9 months ago ### 🟠 Unused materialised versions (2) [from endpoint-versions] - monthly_active_users — v3 materialised, last_executed_at null (currently on v4 — unmaterialise v3) - order_summary — v1 materialised, last_executed_at null ### 🟡 Stale (3)
From PostHog/skills, MIT.
Signals
- Stars
- 75
- Forks
- 8
- Open issues
- 2
- Last commit (this folder)
- Jun 14, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/PostHog/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.587score
auditing-endpoints
PostHogOfficial
Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions.
SkillCFreshness: C★ 95Claude Code +9 - 0.312score
auditing-endpoints
anny-co
Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions.
SkillBFreshness: BClaude Code +9
More from PostHog
- 0.759score
PostHog MCP Server
PostHogOfficial
Official PostHog MCP Server for product analytics, feature flags, experiments, and more.
ConnectorAFreshness: ARemote★ 40.4KClaude Code +3 - 0.754score
code-reviewer
PostHog
Subagent "code-reviewer" from PostHog/posthog: Use this agent when you need expert code review of recently written or modified code.
TemplateAFreshness: A★ 40.4KClaude Code - 0.683score
authoring-log-alerts
PostHogOfficial
Author useful, low-noise log alerts on services in a PostHog project.
SkillAFreshness: A★ 95Claude Code +9 - 0.683score
auditing-experiments-flags
PostHogOfficial
Audit PostHog experiments and feature flags for configuration issues, staleness, and best-practice violations.
SkillAFreshness: A★ 95Claude Code +9 - 0.683score
analyzing-offline-evaluations
PostHogOfficial
Inspect and compare offline AI evaluation experiments, diagnose case-level regressions, and follow scorer history across application, model, or prompt changes.
SkillAFreshness: A★ 95Claude Code +9 - 0.683score
authoring-error-tracking-alerts
PostHogOfficial
Author error tracking alerts that fire when an issue is created, reopened, or starts spiking.
SkillAFreshness: A★ 95Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get auditing-endpoints running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
auditing-endpoints skill. Agent Mart. https://agentmart.dev/skills/posthog-auditing-endpoints-fcc8d2 (last updated 2026-10-24)