Ira Bodnar··Updated ·13 min read

Claude Skills for PostHog: 10 HogQL Skills + Copy-Paste Prompts

Quick answer: Save each recurring PostHog question as a Claude skill that names the HogQL query to run. Ryze AI is the best Claude connector for running these skills when you want PostHog next to ad and SEO data in one connection, with one caveat: it connects one PostHog project per workspace.

Below: 10 SKILL.md files, the PostHog tables and fields each uses, install steps and quick prompts.

Ryze AI · Paid Ads

PostHog skills on live data

  • 7-day free trial, $89 a month flat

Used by 2,000+ marketers

Uber Eats logoadidas logoDuolingo logoMGM Resorts logoWharton logoLendingClub logoNorton logoEventbrite logoHuel logoTogether AI logoghd logoHack The Box logo

The 10 Claude skills for PostHog at a glance

Eight skills only read. Two (cohort builder and dashboard builder) create objects, and you can leave them off.

  1. 01Weekly product digestEvents and visitors, week over week

    Main PostHog fields: event, distinct_id, timestamp

    Access: Read

  2. 02Top pagesMost viewed URLs and their trend

    Main PostHog fields: properties.$current_url, $pageview

    Access: Read

  3. 03Traffic source qualityWhich channels bring engaged sessions

    Main PostHog fields: $channel_type, $entry_utm_source, $is_bounce

    Access: Read

  4. 04Landing page bounceEntry pages that lose visitors

    Main PostHog fields: $entry_pathname, $is_bounce, $session_duration

    Access: Read

  5. 05UTM and click id auditMissing or inconsistent campaign tags

    Main PostHog fields: $entry_utm_campaign, $entry_gclid

    Access: Read

  6. 06Signup funnelWhere visitors drop between steps

    Main PostHog fields: event, distinct_id

    Access: Read

  7. 07Event auditEvents that stopped or never fire

    Main PostHog fields: event definitions, event counts

    Access: Read

  8. 08Feature flag reviewFlags to clean up or check

    Main PostHog fields: feature flags

    Access: Read

  9. 09Cohort builderSave a segment as a cohort

    Main PostHog fields: persons, events

    Access: Write

  10. 10Dashboard builderGroup insights into one dashboard

    Main PostHog fields: insights, dashboards

    Access: Write

Every query in these skills uses a table or field named in PostHog's own docs, listed in Sources. PostHog was not connected to a test workspace when this page was written, so run each skill once on your project and check the first answer against a PostHog insight.

What are Claude skills for PostHog?

A Claude skill for PostHog is a saved SKILL.md file that tells Claude which HogQL query to run and what to hand back. Per Anthropic's Agent Skills docs, the file starts with a name and a description, and Claude loads the rest only when a request matches the description.

The name allows up to 64 lowercase letters, numbers and hyphens and cannot contain the words claude or anthropic, so every skill here starts with posthog. The description, up to 1,024 characters, says what the skill does and when to use it.

  1. What it is

    One-off prompt
    A question in chat
    Skill
    A saved file with a fixed query and output
    PostHog connection
    Tools Claude uses to query PostHog
  2. Setup

    One-off prompt
    None
    Skill
    Save once per Claude app
    PostHog connection
    A PostHog personal API key and host
  3. Same result each run

    One-off prompt
    No
    Skill
    Yes
    PostHog connection
    Depends on the prompt or skill

The queries are written in HogQL, PostHog's SQL dialect. It reads the events and persons tables, and event properties use dot notation such as properties.$current_url. Session fields such as $entry_utm_source and $channel_type live in the sessions table.

How to install the skills in Claude Code and claude.ai

Claude Code

Save each block as ~/.claude/skills/<skill-name>/SKILL.md for yourself, or .claude/skills/<skill-name>/SKILL.md in a project to share it with the team. Claude picks a skill when your request matches it, or you type /posthog-weekly-digest (Claude Code skills docs).

claude.ai

Zip each skill folder and upload it as a custom skill. Anthropic lists custom skills on Pro, Max, Ultra, Team and Enterprise plans with code execution enabled.

Connect the data

The PostHog MCP page lists the 3 PostHog tools on the Ryze AI connector. The setup below covers the PostHog key and the connector.

Custom skills do not sync across surfaces: a skill uploaded to claude.ai is not in Claude Code, and the reverse. Anthropic advises using skills only from sources you trust, so read each file before you save it. More free skills are in the Claude skills library.

Reporting skills: the weekly and page view

These two answer the weekly questions. Every query carries a time window and a LIMIT of 1,000 or less, because PostHog stops unbounded HogQL queries.

01. Weekly product digest

Compares the last 7 complete days with the 7 before, by event name, and names the events behind each change in visitors.

SKILL.md
--- name: posthog-weekly-digest description: Weekly PostHog recap of events and unique visitors, last 7 days against the 7 days before. Use for weekly product or traffic summaries. --- # PostHog weekly digest Call posthog__read with a HogQL query (time window and LIMIT 200 required): SELECT event, count() AS events, count(DISTINCT distinct_id) AS people FROM events WHERE timestamp >= now() - INTERVAL 14 DAY GROUP BY event ORDER BY events DESC LIMIT 200 Run it twice: the last 7 days and the 7 days before. Skip events under 20 occurrences. Steps: 1. Compute the percent change in events and people per event. 2. Rank by the change in people. Output: 5 short sentences, then a table with the change against last week. Use query numbers only.

Use it when: you send a Monday update or need one line per event.

02. Top pages

Lists the most viewed URLs from the $pageview event and compares them with the previous period.

SKILL.md
--- name: posthog-top-pages description: Ranks the most viewed pages in PostHog by $pageview and compares with the previous period. Use when asked which pages get traffic. --- # PostHog top pages Call posthog__read (HogQL), last 28 days, LIMIT 100: SELECT properties.$current_url AS url, count() AS views, count(DISTINCT distinct_id) AS people FROM events WHERE event = '$pageview' AND timestamp >= now() - INTERVAL 28 DAY GROUP BY url ORDER BY views DESC LIMIT 100 Run the same query for the 28 days before. Group URLs that differ only by query string. Output: a table of the top 20 URLs with views, people and the change against the prior period, then the 3 biggest risers and fallers.

Use it when: you plan content or check what a release changed.

Acquisition skills: where visitors come from

These three read the sessions table, which holds the entry page, referrer, UTM values and channel for each session.

03. Traffic source quality

Ranks channels by what visitors do after landing and flags channels with many sessions and a high bounce rate.

SKILL.md
--- name: posthog-traffic-quality description: Compares PostHog traffic channels on bounce, duration and pageviews per session. Use when asked which sources bring engaged visitors. --- # PostHog traffic source quality Call posthog__read (HogQL) on the sessions table, last 28 days, LIMIT 200: - group by: $channel_type, $entry_utm_source - measures: count of sessions, share with $is_bounce, average $session_duration, average $pageview_count - filter on $start_timestamp If a field name is rejected, ask posthog__read for the sessions table columns and retry. Steps: 1. Skip rows under 50 sessions. 2. Flag rows above the median in sessions and above the site bounce share. Output: a table sorted by sessions, flagged rows first, one line per flag.

Use it when: you plan next month's channel mix.

04. Landing page bounce

Lists entry pages with traffic and a high bounce share, using the entry path of each session.

SKILL.md
--- name: posthog-landing-bounce description: Finds PostHog entry pages with many sessions and a high bounce share. Use when asked which landing pages to fix first. --- # PostHog landing page bounce Call posthog__read (HogQL) on the sessions table, last 28 days, LIMIT 200: - group by: $entry_pathname - measures: sessions, share with $is_bounce, average $session_duration - filter on $start_timestamp Steps: 1. In the top 50 pages by sessions, flag pages 15 points above the site bounce share. 2. Add a second pass by $entry_utm_source for the 5 worst pages. Output: a fix-first table ordered by sessions, one sentence per page on what to check.

Use it when: you need a short, traffic-ordered list of pages to fix.

05. UTM and click id audit

Finds campaigns written several ways and sessions that arrive with a Google click id but no UTM campaign.

SKILL.md
--- name: posthog-utm-audit description: Audits PostHog session UTM values and click ids for tagging mistakes. Use before a monthly report or when campaign numbers do not match the ad platform. --- # PostHog UTM and click id audit Call posthog__read (HogQL) on the sessions table, last 90 days, LIMIT 500: - group by: $entry_utm_source, $entry_utm_medium, $entry_utm_campaign - measures: sessions, sessions with $entry_gclid not empty Steps: 1. Group values that differ only by case or spelling (facebook, Facebook, fb). 2. List rows with $entry_gclid set and an empty $entry_utm_campaign. 3. List rows with a campaign and an empty medium. Output: a fix table: current value, sessions, tag to use.

Use it when: before a monthly report, or when PostHog campaign counts differ from the ad platform.

Product skills: funnels, events and flags

These three check what visitors do in the product and whether the setup is healthy. They only read.

06. Signup funnel

Counts distinct people at each step event. This is an approximation: it does not check order. PostHog's funnel insight offers sequential, strict order and any order, with a conversion window, so use it when order matters (funnel docs).

SKILL.md
--- name: posthog-signup-funnel description: Approximate PostHog funnel from distinct people per step event. Use when asked where visitors drop between landing and signup. --- # PostHog signup funnel Ask the user for 3 to 5 step events (for example $pageview, signup_started, signup_completed). Call posthog__read (HogQL), last 28 days, LIMIT 20: SELECT event, count(DISTINCT distinct_id) AS people FROM events WHERE event IN (<step events>) AND timestamp >= now() - INTERVAL 28 DAY GROUP BY event Steps: 1. Order the rows by the step order the user gave. 2. Compute the share kept from each step to the next. 3. State that the counts do not check order or a conversion window. Output: a step table and the weakest step.

Use it when: you need a first look at the drop-off before building a funnel insight.

07. Event audit

Lists the event definitions in the project and compares them with the events that fired recently, to find dead or duplicated events.

SKILL.md
--- name: posthog-event-audit description: Read-only check of PostHog event definitions against events that fired in the last 28 days. Use when taking over a project or after a release. --- # PostHog event audit 1. Call posthog__read for the event definitions of the project. 2. Call posthog__read (HogQL): SELECT event, count() AS events, max(timestamp) AS last_seen FROM events WHERE timestamp >= now() - INTERVAL 28 DAY GROUP BY event ORDER BY events DESC LIMIT 500 Steps: list defined events with no events in the window, busy events with no definition, and names that differ only by case or separator. Output: a checklist for PostHog. Change nothing.

Use it when: you take over a project, or right after a release to confirm an event still fires.

08. Feature flag review

Reads the feature flags of the project and lists the ones to look at before a cleanup.

SKILL.md
--- name: posthog-flag-review description: Reviews PostHog feature flags and lists ones to check or remove. Use for a monthly flag cleanup. --- # PostHog feature flag review Call posthog__read for the feature flags of the project. Steps: 1. List each flag with its key, whether it is active and its rollout. 2. Flag keys that look temporary (test, tmp, old) and flags at full rollout. 3. Ask which flags the user wants to act on. Output: a table of flags to check, one line on why. Do not change or delete a flag in this skill.

Use it when: you run a monthly flag cleanup. Changes stay in PostHog or in a separate request.

Build skills: cohorts and dashboards

These two use posthog__write to create objects. They only work when the PostHog key has write scopes, and PostHog rejects any change on a read-only key. In Claude, set write and delete tools to Needs approval if you want to confirm each change.

09. Cohort builder

Turns a plain description of a segment into a cohort, after the user confirms the definition.

SKILL.md
--- name: posthog-cohort-builder description: Creates a PostHog cohort from a described segment after confirming it. Use when asked to save a group of users as a cohort. --- # PostHog cohort builder 1. Restate the segment as a rule (for example: people with a $pageview on a pricing URL in the last 30 days and no signup_completed). 2. Call posthog__read (HogQL, time window, LIMIT 100) to show how many people match and a sample of 10. 3. Wait for the user to confirm the name and rule. 4. Call posthog__write to create the cohort. Output: the cohort name, the rule and the match count. Never delete a cohort in this skill.

Use it when: you want to reuse a segment in insights or flags.

10. Dashboard builder

Groups the insights a recurring review needs into one dashboard.

SKILL.md
--- name: posthog-dashboard-builder description: Creates a PostHog dashboard from existing insights for a named review. Use when asked to set up a weekly or launch dashboard. --- # PostHog dashboard builder 1. Ask what the review is for (weekly traffic, launch, onboarding). 2. Call posthog__read for the existing insights and dashboards, and list the 5 to 8 that fit. 3. Wait for the user to confirm the list and the dashboard name. 4. Call posthog__write to create the dashboard. Output: the dashboard name and the insights on it. If an insight is missing, say so and offer to create it.

Use it when: you set up a recurring review. The integrations hub lists the other platforms Ryze AI connects.

Quick PostHog prompts: no skill file needed

For a one-time question, a plain prompt is enough once Claude can reach PostHog. Replace the words in brackets and keep the time window.

Prompt
In PostHog, which 10 URLs had the most $pageview events in the last 7 days? Use a time window and LIMIT 100.
Prompt
List the 20 most frequent events in my PostHog project over the last 28 days with the number of distinct people for each.
Prompt
Which $entry_utm_source values sent the most sessions in the last 28 days, and what share of those sessions bounced?
Prompt
Show the feature flags in my PostHog project and tell me which are active.

If an answer looks off, ask Claude to show the HogQL query it sent.

How to run the skills on live PostHog data

A skill only describes the query; Claude needs a connection to run it. The Ryze AI connector gives Claude 3 PostHog tools:

  1. posthog__read

    What it does
    Reads projects, insights, dashboards, feature flags, cohorts, persons and event definitions, and runs HogQL queries
    Used by
    Skills 01 to 10
  2. posthog__write

    What it does
    Creates or updates insights, dashboards, feature flags and cohorts
    Used by
    Skills 09 and 10
  3. posthog__delete

    What it does
    Deletes a PostHog object by path, such as a cohort; irreversible
    Used by
    None of these skills

Connect PostHog in 4 steps

Create a key

In PostHog, open Settings, Personal API keys, click Create key, grant read access to the project with the Query and Insight scopes, and copy the phx_ key. Add write scopes only for skills 09 and 10.

Connect in Ryze AI

In the Ryze AI app, open Integrations, click Connect on the PostHog card, paste the key, enter the host (https://us.posthog.com, https://eu.posthog.com or a self-hosted URL), then pick the Project and click Save.

Add the connector

Add https://connector.get-ryze.ai/mcp in Claude under Customize, Connectors and include the workspace. If you added it before connecting PostHog, remove and re-add it, then start a new chat.

Run a skill

Ask a question that matches a skill description, or type the skill name in Claude Code, and check the query Claude sent.

Details are in the Ryze AI help center PostHog page and the Claude connect guide. The full tool reference is on the PostHog MCP page. Connecting the connector is free; the tools need an active plan or trial, from Paid Ads at $89 a month with a 7-day free trial (see pricing).

Ryze AI connects one PostHog project per connection, and what the agent can change is limited by the scopes on the key. The same connector carries the other Ryze AI platforms, so the Ryze AI chat can read PostHog next to ad and SEO data. PostHog also runs its own hosted MCP server at https://mcp.posthog.com/mcp, which routes you to the US or EU region from your PostHog login and covers more of PostHog, such as error tracking and experiments (PostHog MCP docs). Skills work with either; the table names in these skills do not change.

In the Ryze AI app, the same instructions can run as a scheduled task every day, week or month. Scheduled tasks run without an approval step, so use a read-only key for tasks that should never change PostHog.

Approvals

The Ryze AI chat starts on Skip all approvals, so the agent runs PostHog tools on its own by default. Switch the Tool approvals picker to Approve write & delete (reads run freely, changes need approval) or Manual approve. In Claude, set write and delete tools to Needs approval under Customize, Connectors, Ryze AI, Tool permissions.

Troubleshooting: when a PostHog skill returns a wrong answer

Claude has no PostHog tools

Claude keeps the tool list from when you added the connector. Remove and re-add it, then start a new chat (Ryze AI connector FAQ).

The query is stopped

PostHog stops unbounded HogQL queries. Add a time window on timestamp or $start_timestamp and a LIMIT of 1,000 or less.

A change is rejected

The personal API key has read scopes only. Add the write scope for that object type in PostHog, or make the change in PostHog.

A field name is rejected

Ask Claude to list the columns of the table and retry. Session fields start with $ and live in the sessions table, while event properties use properties.$name.

Wrong project

Ryze AI holds one PostHog project per connection. To switch, click View on the PostHog card, disconnect and connect again, or use another workspace.

Rate limit errors

PostHog lists limits per key: 240 a minute and 1,200 an hour for analytics endpoints, and 2,400 an hour for the query endpoint (PostHog API docs). Run fewer skills at once.

Numbers differ from the ad platform

PostHog and ad platforms count visits and conversions differently. Pick one source per decision.

Sources

The verdict

Turn each recurring PostHog question into a skill with a fixed HogQL query. Start with the weekly digest and traffic source quality, run the event audit before you trust the numbers, and keep one-off questions as prompts.

Ryze AI runs these skills in Claude on live PostHog data through 3 tools. Use a read-only key unless you want skills 09 and 10, and check the first answer of each skill against a PostHog insight.

Frequently asked questions

What are Claude skills for PostHog?
SKILL.md files that tell Claude which HogQL query to run on your PostHog project and how to present the result. Claude loads one when a request matches its description, so each check runs the same way every time.
Do I need a PostHog connection to use these skills?
No. Each skill also works on an export you attach, if it has the columns the skill names. A connection removes the export step and lets Claude run the HogQL itself.
Which Claude plan do I need?
Anthropic lists custom skill uploads on claude.ai for Pro, Max, Ultra, Team and Enterprise with code execution enabled. In Claude Code, skills are folders on your computer. Anthropic lists custom connectors on every Claude plan, with one custom connector on Free.
Can Claude change my PostHog data through these skills?
Only skills 09 and 10 write, and only if the personal API key has write scopes. Skill 08 reads flags and changes nothing. With a read-only key, PostHog rejects every change.
Show 7 more questions
Which PostHog key scopes do I need?
Read access to the project with the Query and Insight scopes. Add write scopes only for the objects you want the agent to change. The key starts with phx_ and is pasted in the Ryze AI app with your host.
Does it work with EU Cloud and self-hosted PostHog?
Yes. Enter https://us.posthog.com, https://eu.posthog.com or your self-hosted URL as the host when you connect PostHog in Ryze AI.
Why do the queries have a time window and a LIMIT?
PostHog stops unbounded HogQL queries. Every skill filters on timestamp or $start_timestamp and sets a LIMIT of 1,000 or less.
How is this different from the PostHog MCP server?
PostHog hosts its own MCP server at https://mcp.posthog.com/mcp, with sign-in through PostHog and more product areas. Ryze AI gives 3 PostHog tools on the same connector as its ad and SEO tools. The skills here work with either.
Can these skills run on a schedule?
Yes, in the Ryze AI app. A scheduled task runs the same instructions every day, week or month. Scheduled tasks run without an approval step, so use a read-only key for tasks that should only report.
Can I connect more than one PostHog project?
Not in one workspace. Ryze AI holds one PostHog project per connection. To switch, disconnect and connect again, or put the other project in another workspace.
Can the skills use ChatGPT instead of Claude?
The SKILL.md format is Anthropic's. The HogQL queries inside work as prompts in any client connected to the Ryze AI connector, such as ChatGPT or the Ryze AI chat.

Related guides

Ryze AI: PostHog skills on live data

7-day free trial, $89 a month flat

Start free trial