Simulate returning user

From PostHog/posthog · View interactive version

Simulate returning user is an AI agent skill from the GitHub repository PostHog/posthog. 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.

How to use this skill

Skill file

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

session (no fresh anonymous IDs per page).

reports.

How to invoke

Call the simulate_returning_user MCP tool with:

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:

run_id query param) — session stitching works.

storage-permissions issue. Inspect the raw posthog_requests for $session_id

values to diagnose.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.