posthog/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 skills add https://github.com/PostHog/posthog --skill simulate-returning-user
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.
distinct_id across page views in asession (no fresh anonymous IDs per page).
$pageview fires on every page view, not just the first.reports.
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.
The structured response shape matches simulate_new_user. Key signals:
verified: true and pageviews >= page_views — the session works.distinct_id across all pageviews (visible in PostHog UI under therun_id query param) — session stitching works.
distinct_id per visit — likely a cookie domain orstorage-permissions issue. Inspect the raw posthog_requests for $session_id
values to diagnose.
Take posthog/simulate-returning-user 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.