Picks the single most useful session recording linked to an error tracking issue, out of what can be hundreds, instead of leaving someone to guess.
WHEN TO USE
SCOPE
USE FOR
Find the one recording worth watching out of hundreds linked to a single error.
See what a user was doing right before an error happened, not just the crash itself.
Get a written summary of a session instead of watching the full recording.
This is a saved copy of the skill's SKILL.md instructions. It may differ from the upstream file or the version you install.
Finding the best replay for an error tracking issue
When a user says "show me a replay for this error" or "find a recording for issue X",
the goal isn't just any linked session — it's the one that best shows what led to the error.
Popular issues can have hundreds of linked sessions, and most are crash-only fragments
or duplicate occurrences. This skill picks the most useful one.
Note the issue's fingerprint, name, and description — you'll need the fingerprint
to find linked sessions.
Step 2 — Find sessions with this error
Query exception events to get session IDs where this error occurred.
Order by recency and include basic context:
posthog:execute-sql
SELECT
$session_id AS session_id,
count() AS occurrences,
min(timestamp) AS first_seen,
max(timestamp) AS last_seen,
any(properties.$current_url) AS url
FROM events
WHERE event = '$exception'
AND properties.$exception_fingerprint = '<fingerprint>'
AND $session_id IS NOT NULL
AND timestamp > now() - INTERVAL 30 DAY
GROUP BY session_id
ORDER BY last_seen DESC
LIMIT 20
This gives you up to 20 candidate sessions. More candidates means better selection.
Step 3 — Rank the candidates
Fetch recording metadata for the candidate sessions to rank them:
Pick the best recording by filtering out bad candidates, then ranking what's left:
Filter out:
Sessions under 10 seconds (crash-only fragments, no pre-error context)
Sessions over 1 hour (too much data to load, error is a needle in a haystack)
Rank by:
Sweet-spot duration — 2-15 minutes is ideal. Long enough to show the user's
journey before the error, short enough to be practical to watch or summarize.
Active time ratio — compare active_seconds to recording_duration. A 20-minute
recording with 10 seconds of activity is mostly idle tabs — the user walked away.
Prefer sessions where active_seconds / recording_duration is above 0.3 (30%).
Activity score — higher activity_score means the user was actively interacting,
not idle. More interesting to watch.
Recency — more recent sessions reflect current app behavior.
Why this one — briefly explain the selection ("longest session with the error,
user was browsing 3 pages before hitting it")
Pre-error context — what pages the user visited and key actions before the exception,
derived from the events query in step 2 (the url and first_seen columns)
Error frequency — how many times the error occurred in this session
Optional: AI summary via Replay Vision
If the user wants a narrative summary without watching, use Replay Vision —
"check-then-scan", since a scanner can only observe a given session once.
Check for an existing summary on the selected recording:
If an observation has scanner_snapshot.scanner_typesummarizer and
statussucceeded, read scanner_result.model_output (title, summary,
intent, outcome, friction_points, keywords) — done.
Retrieve by polling vision-observations-list until succeeded.
Tips
If all candidate sessions are very short (<10 seconds), the error likely crashes
the page immediately. Note this — it's useful context even without a long replay.
When the issue has very few linked sessions (<3), skip the ranking and just present
what's available with a note about the small sample.
If $session_id is null on many exception events, session replay may not be enabled
for the affected users. Mention this as a possible gap.
Replay Vision has no per-call focus parameter — a summarizer scanner's focus
comes from its own prompt. For error-focused summaries, prefer (or create) a
summarizer scanner whose prompt targets error/exception context rather than the
whole session.
Related skills
investigating-error-issue — the quantitative side: volume, breakdowns, and stack traces for the same issue
investigating-replay — deep-dive one of the linked sessions
diagnosing-missing-recordings — when exception events have no $session_id or the linked recordings are gone
MCP connection required
1 FOR YOU
01
Connect the PostHog MCP server
Connect PostHog's MCP server to your AI client so the skill can query error tracking issues, session recordings, and Replay Vision through its dedicated MCP tools.
Listed as free
Connected services may require an account or charge fees.
Installation
One command — usually under 2 minutes.
🔌 This skill ships inside the PostHog AI Plugin. Listed package contents include 3 slash commands, 1 agent, hooks and an MCP server. Installed components and skill versions may vary by AI tool.
Install just this skill
Run this outside your AI tool, using Node.js 22.20.0 or newer. Skills CLI 1.7.2 skips skill selection; prompts cancel installation without an interactive terminal. If choosing Project when asked about installation scope, open your project's folder before running this.
Install checklist
Check selected tools if a picker appears; Claude Code may be unchecked under Additional agents. ↑/↓ moves, Space toggles selections, Enter confirms.
Without a tool picker, check Installing to: for your intended tool. Stop if it names a different tool.
If asked, choose Symlink (Recommended) for shared files or Copy to all agents for separate copies; review the summary before confirming installation.
Install the find-skills skill? defaults to Yes, adding another skill for all projects. Choose No if you don't want that extra installation.
Skills CLI 1.7.2 sends install data to skills.sh by default, including the source, skill names, target tools and file details; GitHub sources are reported only when GitHub confirms the repository is public, while other remote sources can also be reported. Confirmed-public GitHub sources also trigger a security-audit request. Before installing, set the environment variable DO_NOT_TRACK=1 or DISABLE_TELEMETRY=1 to disable both.
After installing for Claude Code, open it in the installation project if you chose Project; Global makes the skill available across projects on this computer. Once Claude Code loads the skill, its description helps Claude decide when to use it.
If installation created a top-level skills folder that did not exist when your Claude Code session started, run /reload-skills in that session. Run it again after later changes in that folder.
MCP server required
The skill's steps call for tools from the PostHog MCP server. Installing just this skill doesn't add that connection; set it up in your AI tool if it isn't there yet: PostHog MCP setup. Installing the whole plugin instead includes the connection settings.
Requirements for the PostHog MCP server
Connecting is free; sign in with your PostHog account.
Some tools use AI internally and may incur PostHog AI charges. Those tools require AI data processing to be enabled in your organization settings.
Install the whole plugin
This route installs the posthog plugin package selected for your AI tool.
Claude Code
Add PostHog's marketplace, then install the plugin
Run both lines in a terminal. They install PostHog's posthog plugin: this skill, PostHog's other skills, and a connection to PostHog's hosted MCP server.
01
claude plugin marketplace add PostHog/ai-plugin
02
claude plugin install posthog@posthog
Installation and loading
The plugin installs for you in every project and loads the next time you start Claude Code, or after /reload-plugins in an open session.
To connect your PostHog account, start claude, type /mcp, select plugin:posthog:posthog and follow the browser prompts.
Good to know
The plugin includes PostHog's session-capture hook; PostHog's README says it sends sessions to LLM Analytics only when POSTHOG_LLMA_CC_ENABLED=true and POSTHOG_API_KEY are both set.
If you use the separate posthog-telemetry plugin, PostHog says to keep only one of the two, because both register the same hook.
On a self-hosted PostHog, this route's MCP connection won't reach your instance: the plugin's config is fixed to https://mcp.posthog.com/mcp, which routes to PostHog's US or EU region. POSTHOG_MCP_URL works only for the Gemini CLI extension.
Sync columns from a synced data warehouse table onto PostHog person or group properties, so warehouse data becomes usable anywhere person and group properties already work: feature flag targeting, cohorts, insight filters and breakdowns, surveys, session replay filters, workflows, and the person profile. Use when the user wants to "add a person property from my warehouse", "enrich people with Stripe/Postgres/Salesforce data", "put ARR or plan tier on my persons", "target a feature flag by a warehouse column", "sync warehouse columns onto groups or organizations", or wants to inspect, backfill, disable, or debug an existing warehouse-backed person or group property.Read full description
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.Read full description
Analyze session replay patterns across experiment variants to understand user behavior differences. Use when the user wants to see how users interact with different experiment variants, identify usability issues, compare behavior patterns between control and test groups, or get qualitative insights to complement quantitative experiment results. Also covers pairing the observed behavior with a linked survey when the user wants qualitative feedback beyond what recordings show.Read full description
Assesses what a page's heatmap is telling you and recommends concrete changes. Pulls click / rageclick / scroll-depth data for a URL, names the hot elements by cross-referencing autocapture events on the same page, and can create a saved heatmap the user opens in PostHog, then summarizes the behavior and proposes improvements.
TRIGGER when: user asks what a heatmap shows, why people aren't clicking something, where users rage-click, how far they scroll, what to change on a page based on heatmap/click data, or to 'analyze/assess/review the heatmap' for a URL.
DO NOT TRIGGER when: the user only wants to create a saved heatmap screenshot with no analysis (use heatmaps-saved-create directly), or is asking about session replay in general (use investigating-replay).Read full description
Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions. Use when the user asks "what endpoints can I clean up?", "are any of my endpoints broken?", "which materialised versions are still being called?", or wants a one-shot cleanup pass over the Endpoints product. Produces a prioritised report grouped by issue type, with recommended actions but does not modify anything without explicit confirmation.Read full description
Audit PostHog experiments and feature flags for configuration issues, staleness, and best-practice violations. Read when the user asks to audit, health-check, or review experiments or feature flags, check flag hygiene, or verify experiment setup.Read full description