posthog/analyzing-insights-across-teams
> Analyze PostHog insights, dashboards, or teams beyond the current project by querying the prod Postgres replicas synced into the dogfood data warehouse (US project 2, "PostHog App + Website"). Use when asked to analyze insights across all teams or projects, another team's insights, or fleet-wide insight/dashboard usage — cases where `system.insights` only returns the current project's rows and the agent would otherwise report the data as inaccessible. Covers the synced table names for US and EU and the column-verification workflow.
npx skills add https://github.com/PostHog/posthog --skill analyzing-insights-across-teams
system.* entity tables (e.g. system.insights) are scoped to the current project,
and the generic execute-sql guidance says other teams' data is inaccessible.
For the dogfood project (US project 2) that is not the whole story:
production Postgres tables are replicated into the project's data warehouse,
so cross-team entity metadata is queryable with posthog:execute-sql.
Do not stop at system.insights when the question spans teams.
This skill is deliberately repo-local (.agents/skills/): it documents PostHog's internal dogfood setup,
applies only to agents working in this repo, and must not move into the packaged products/*/skills/ bundle that ships to every team.
| Entity | US (prod-us) | EU (prod-eu) |
| ---------------- | -------------------------------- | ----------------------------------- |
| Insights | postgres.posthog_dashboarditem | eu_postgres_posthog_dashboarditem |
| Dashboards | postgres.posthog_dashboard | eu_postgres_posthog_dashboard |
| Teams / projects | postgres.posthog_team | eu_postgres_posthog_team |
postgres_posthog_dashboarditem) point at the same synced data.posthog_dashboarditem backs the Insight model), so rows span every team; team_id is the scoping column. SELECT table_name, description
FROM system.information_schema.tables
WHERE table_type = 'data_warehouse' AND table_name ILIKE '%postgres%'
SELECT column_name, data_type
FROM system.information_schema.columns
WHERE table_name = 'postgres.posthog_dashboarditem'
posthog:execute-sql, filtering or grouping by team_id. Example — most active teams by insights created in the last 30 days: SELECT team_id, count() AS insights_created
FROM postgres.posthog_dashboarditem
WHERE NOT deleted AND saved AND created_at >= now() - INTERVAL 30 DAY
GROUP BY team_id
ORDER BY insights_created DESC
LIMIT 20
Join postgres.posthog_team on id = team_id for team names only when the output stays on an internal surface (see below).
Rows in these tables are customer data: team names, insight names, descriptions, and queries.
team_id-level figures without names are the ceiling for public copy.query-clickhouse-via-metabase skill instead.Take posthog/analyzing-insights-across-teams from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.