/simulate-returning-user
Send synthetic single-session multi-page traffic to a URL and confirm PostHog $pageview events fire across page views. Use when verifying that cookies persist correctly, that the same distinct_id is reused across navigations, or when debugging session-stitching issues.
$ npx -y skills add posthog/posthog --skill simulate-returning-user --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
/simulate-returning-user
Context preview
The summary Claude sees to decide when to auto-load this skill.
Send synthetic single-session multi-page traffic to a URL and confirm PostHog $pageview events fire across page views. Use when verifying that cookies persist correctly, that the same distinct_id is reused across navigations, or when debugging session-stitching issues.
SKILL.md
simulate-returning-user.SKILL.mdname: simulate-returning-user
description: >
Send synthetic single-session multi-page traffic to a URL and confirm
PostHog $pageview events fire across page views. Use when verifying that
cookies persist correctly, that the same distinct_id is reused across
navigations, or when debugging session-stitching issues.
Simulate returning-user traffic
Drives a single browser context across N page views (cookies and localStorage persist), navigating between pages and reporting which PostHog events fired. This matches the behavior of a single visitor browsing multiple pages on the same site.
When to use
- Confirm that PostHog reuses the same `distinct_id` across page views in a
session (no fresh anonymous IDs per page).
- Confirm `$pageview` fires on every page view, not just the first.
- Reproduce "session not stitching" or "events split across multiple users"
reports.
How to invoke
Call the `simulate_returning_user` MCP tool with:
- `url` (required) — the page to visit each iteration.
- `page_views` (default `3`) — number of page views in the session.
- `interval` (default `5.0`) — seconds between page views.
- `posthog_host` (default `https://us.i.posthog.com`).
To exercise multi-page navigation, call the tool once per URL — the cookies won't carry across calls (each call is a separate Playwright context). For true multi-page browsing within one session, edit the URL list passed to the underlying CLI: `traffic-sim returning-user --url A --url B --url C`.
Interpreting the result
The structured response shape matches `simulate_new_user`. Key signals:
- `verified: true` and `pageviews >= page_views` — the session works.
- Same `distinct_id` across all pageviews (visible in PostHog UI under the
run_id query param) — session stitching works.
- Different `distinct_id` per visit — likely a cookie domain or
storage-permissions issue. Inspect the raw `posthog_requests` for `$session_id` values to diagnose.
Read more
name: simulate-returning-user description: > Send synthetic single-session multi-page traffic to a URL and confirm PostHog $pageview events fire across page views. Use when verifying that cookies persist correctly, that the same distinct_id is reused across navigations, or when debugging session-stitching issues.
Simulate returning-user traffic
Drives a single browser context across N page views (cookies and localStorage persist), navigating between pages and reporting which PostHog events fired. This matches the behavior of a single visitor browsing multiple pages on the same site.
When to use
- Confirm that PostHog reuses the same `distinct_id` across page views in a
session (no fresh anonymous IDs per page).
- Confirm `$pageview` fires on every page view, not just the first.
- Reproduce "session not stitching" or "events split across multiple users"
reports.
How to invoke
Call the `simulate_returning_user` MCP tool with:
- `url` (required) — the page to visit each iteration.
- `page_views` (default `3`) — number of page views in the session.
- `interval` (default `5.0`) — seconds between page views.
- `posthog_host` (default `https://us.i.posthog.com`).
To exercise multi-page navigation, call the tool once per URL — the cookies won't carry across calls (each call is a separate Playwright context). For true multi-page browsing within one session, edit the URL list passed to the underlying CLI: `traffic-sim returning-user --url A --url B --url C`.
Interpreting the result
The structured response shape matches `simulate_new_user`. Key signals:
- `verified: true` and `pageviews >= page_views` — the session works.
- Same `distinct_id` across all pageviews (visible in PostHog UI under the
run_id query param) — session stitching works.
- Different `distinct_id` per visit — likely a cookie domain or
storage-permissions issue. Inspect the raw `posthog_requests` for `$session_id` values to diagnose.
: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

