npx skills add ...
npx skills add posthog/skills --skill posthog-debugger
npx skills add posthog/skills --skill posthog-debugger
Debug and inspect PostHog implementations on any website. Use this skill when a user wants to understand how PostHog is implemented on a page, troubleshoot tracking issues, verify configuration, check what events are being sent, or audit a PostHog setup. Works with Chrome DevTools MCP and Playwright MCP to inspect live websites.
Inspect and debug PostHog implementations on any website using browser automation tools. This skill helps developers and product teams understand exactly how PostHog is configured and what data is being captured.
mcp__chrome-devtools__*) or Playwright MCP (mcp__playwright__*) tools.When a user asks to inspect a PostHog implementation:
?__posthog_debug=true appendedAfter navigating, take a snapshot and look for login indicators:
If you detect a login page or the user mentions the page requires auth:
Keep the browser open - you've already navigated there
Ask the user to log in:
Once the user confirms, take a new snapshot to verify they're authenticated
Add the debug parameter if not already present and reload if needed
Proceed with inspection
mcp__chrome-devtools__navigate_page - Navigate to URLmcp__chrome-devtools__take_snapshot - Get page accessibility treemcp__chrome-devtools__evaluate_script - Run JavaScript to inspect PostHogmcp__chrome-devtools__list_network_requests - See network trafficmcp__chrome-devtools__get_network_request - Get request detailsmcp__chrome-devtools__list_console_messages - Check for errorsmcp__playwright__browser_navigate - Navigate to URLmcp__playwright__browser_snapshot - Get page snapshotmcp__playwright__browser_evaluate - Run JavaScriptmcp__playwright__browser_network_requests - See network trafficmcp__playwright__browser_console_messages - Check consoleAlways add ?__posthog_debug=true to the URL to enable PostHog's debug mode. This outputs detailed logs to the console.
https://example.com?__posthog_debug=truehttps://example.com?foo=bar&__posthog_debug=trueWorkflow:
/login, /signin, /auth, /ssoExecute JavaScript to inspect the posthog object on the window:
If posthog is not on window, check for bundled implementations that use _POSTHOG_REMOTE_CONFIG:
With ?__posthog_debug=true, PostHog outputs detailed logs. Use list_console_messages and look for [PostHog.js] entries:
Key messages to look for:
[PostHog.js] Persistence loaded - Shows persistence type (localStorage, sessionStorage, cookie)[PostHog.js] [Surveys] Surveys loaded successfully - Surveys module loaded[PostHog.js] [Surveys] flags response received, isSurveysEnabled: X - Whether surveys are enabled[PostHog.js] [SessionRecording] - Session recording status[PostHog.js] [WebExperiments] - Web experiments/feature flags[PostHog.js] set_config - Configuration changesImportant distinction:
A module can load but still be disabled. For example:
Look for PostHog scripts in the page:
Filter network requests to find PostHog traffic. PostHog may use:
Standard domains:
*.posthog.comus.i.posthog.com / eu.i.posthog.comus-assets.i.posthog.com / eu-assets.i.posthog.comCustom proxy domains (common patterns):
ph.yourcompany.comanalytics.yourcompany.comt.yourcompany.com/array/phc_ in the path (PostHog config)Endpoints to look for:
/e/ or /capture/ - Events/s/ - Session recording/decide/ or /flags/ - Feature flags/batch/ - Batched events/array/phc_*/config.js - Remote config (bundled implementations)/static/surveys.js - Surveys module/static/recorder.js - Session recording moduleHow to identify a custom proxy:
/flags/, /array/phc_)phc_ tokens in request URLs or bodiesRun diagnostics:
If debug mode is on or we can access the queue:
Scan network requests and scripts to identify all analytics/tracking tools on the page. Use known patterns for named tools, and detect unknown tracking scripts as a fallback.
After inspection, provide a structured summary. Be factual and concise - no commentary or recommendations unless asked. Use emojis to indicate status at a glance.
Status emojis:
Run full inspection workflow and provide complete summary.
/e/ or /capture//s/ network requests/decide/ network requestRun the diagnostic checks and report findings.
Check the api_host configuration:
us.i.posthog.com = US Cloudeu.i.posthog.com = EU Cloudapp.posthog.com = Legacy (defaults to US)User: "How is PostHog implemented on https://example.com?"
Claude: "I'll navigate to example.com with debug mode enabled and inspect the PostHog implementation."
[Navigates to https://example.com?__posthog_debug=true] [Runs JavaScript checks] [Checks console for PostHog debug messages] [Analyzes network requests]
Claude:
Example 2: Authenticated page with custom proxy
User: "Check PostHog on https://app.example.com/dashboard"
Claude: "I'll navigate to that page with debug mode enabled."
[Navigates to https://app.example.com/dashboard?__posthog_debug=true] [Takes snapshot, sees login page]
Claude: "I've opened the page but it requires login. Please log in using the Chrome browser I just opened. Let me know when you're on the dashboard."
User: "I'm logged in"
Claude: [Takes new snapshot, verifies authenticated, runs inspection]