Generated banner for Investigating Replay
Generated logo for Investigating Replay

Investigating Replay

PostHogOfficialPublished by PostHog

  • Skill
  • Workflow
  • Data and AI
  • MIT
  • No issues found

From the author

Investigates a session recording by gathering metadata, person profile, same-session events, and linked error tracking issues in one pass. Use when a user provides a recording or session ID and wants to understand what happened — who the user was, what they did, what errors occurred, and whether there are related error tracking issues. Replaces the manual chain of session-recording-get, persons-retrieve, execute-sql, and query-error-tracking-issues-list.
— the description by PostHog

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a comprehensive, multi-step procedure for analyzing user session recordings. It enables an agent to move beyond simple metadata retrieval by correlating session recordings with person profiles, event timelines, and specific error tracking issues. The workflow is designed to be executed in parallel where possible, allowing the agent to construct a complete narrative of a user's session—including who they are, what actions they took, and any technical issues they encountered—while also offering optional AI-powered summarization via Replay Vision.

What it does

  • Retrieves session recording metadata and associated user profile information.
  • Queries event timelines to reconstruct the user's journey and actions.
  • Identifies and links specific error tracking issues to the session.
  • Synthesizes findings into a coherent narrative covering user context, actions, and problems.
  • Checks for existing AI-generated session summaries or triggers new ones.
  • Provides a fallback mechanism to recover session IDs if events are missing from the recording ID.

When to use it

  • When a user asks for an investigation into a specific session or provides a session ID.
  • When you need to correlate user behavior with technical errors or exceptions.
  • When you need to provide a summary of a user's journey across multiple pages.
  • When you need to determine if a session's errors are linked to known, tracked issues.

Advantages

  • Reduces manual effort by automating the retrieval of disparate data points.
  • Provides a holistic view of user sessions rather than isolated data fragments.
  • Includes built-in logic for handling missing event data or anonymous users.
  • Offers a structured approach to integrating AI-driven session analysis.

Usage examples

“What happened in session 12345?”
The agent retrieves the recording metadata, identifies the user, lists the sequence of page views and errors, and reports any linked error tracking issues.
“Can you summarize the user's experience in this recording?”
The agent checks for an existing AI summary or performs an inline scan to provide a concise overview of the session's intent, outcome, and friction points.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/posthog/investigating-replay/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip investigating-replay.zip -d .agents/skills

Documentation by PostHog

Investigating a session recording

When a user asks "what happened in this session?" or provides a recording/session ID to investigate, gather all relevant context in parallel rather than making them ask for each piece.

Available tools

ToolPurpose
posthog:session-recording-getRecording metadata (duration, counts, status)
posthog:persons-retrievePerson profile (properties, distinct IDs)
posthog:execute-sqlQuery events, errors, and page views in session
posthog:query-error-tracking-issues-listFind error tracking issues linked to the session
posthog:vision-observations-listCheck for an existing Replay Vision AI summary
posthog:vision-observations-getRead one observation in full (scanner_result)
posthog:vision-scanners-inline-scanGenerate an AI summary of the session (slow, optional)
posthog:vision-scanners-listFind saved summarizer scanners (scanner_type=summarizer)
posthog:vision-scanners-scan-sessionRun a saved summarizer scanner on the session (slow)

Workflow

Step 1 — Get recording metadata and person profile

Start with the recording to get metadata and the person's distinct ID:

posthog:session-recording-get
{
  "id": "<session_id>"
}

The recording id and the event $session_id are the same value. It selects the recording here and the same-session events in Step 2. The response includes distinct_id, person, start_time, end_time, duration, interaction counts, console error counts, and viewing status. Use the distinct_id to fetch the full person profile:

posthog:persons-retrieve
{
  "id": "<person_uuid_from_recording>"
}
Step 2 — Query same-session events

Use the recording id from Step 1 as the $session_id value. Get the timeline of what the user did during the session:

posthog:execute-sql
SELECT
    timestamp,
    event,
    properties.$current_url AS url,
    properties.$browser AS browser,
    properties.$os AS os,
    properties.$device_type AS device_type,
    properties.$screen_width AS screen_width
FROM events
WHERE $session_id = '<session_id>'
ORDER BY timestamp ASC
LIMIT 200

For sessions with many events, focus on the most informative ones:

posthog:execute-sql
SELECT
    timestamp,
    event,
    properties.$current_url AS url,
    if(event = '$exception', properties.$exception_values[1], null) AS exception_message,
    if(event = '$exception', properties.$exception_types[1], null) AS exception_type
FROM events
WHERE $session_id = '<session_id>'
    AND event IN ('$pageview', '$pageleave', '$autocapture', '$exception', '$rageclick')
ORDER BY timestamp ASC
LIMIT 100
No rows? Recover the event session ID

The recording id is the session ID. No rows means the session's events were ingested without it. Find candidates from the person's events in the recording window, padded by 100 seconds like the replay events query. person_id covers all of the person's distinct IDs:

posthog:execute-sql
SELECT
    properties.$session_id AS session_id,
    count() AS event_count,
    min(timestamp) AS first_seen,
    max(timestamp) AS last_seen
FROM events
WHERE person_id = '<person_uuid>'
    AND timestamp >= toDateTime('<start_time>') - INTERVAL 100 SECOND
    AND timestamp <= toDateTime('<end_time>') + INTERVAL 100 SECOND
    AND properties.$session_id IS NOT NULL
GROUP BY session_id
ORDER BY event_count DESC
LIMIT 10

Continue only when one session ID clearly matches. Use it for the Step 2 and Step 3 queries only. The replay URL and all Replay Vision calls take the recording id.

Step 3 — Check for linked error tracking issues

If the recording has console errors or exceptions, find related error tracking issues:

posthog:execute-sql
SELECT DISTINCT
    properties.$exception_fingerprint AS fingerprint,
    properties.$exception_types[1] AS type,
    properties.$exception_values[1] AS message,
    count() AS occurrences
FROM events
WHERE $session_id = '<session_id>'
    AND event = '$exception'
GROUP BY fingerprint, type, message
ORDER BY occurrences DESC
LIMIT 10

If fingerprints are found, search for the corresponding error tracking issues to provide links and status:

posthog:query-error-tracking-issues-list
{
  "searchQuery": "<exception_type or message>"
}
Step 4 — Synthesize the investigation

Present the findings as a coherent narrative:

  1. Who — person properties (name, email, country, plan, etc.)

  2. What — sequence of pages visited and key actions taken

  3. Problems — exceptions, console errors, rage clicks, and their frequency

  4. Related issues — linked error tracking issues with their status (active/resolved)

  5. Context — session duration, device/browser, activity score

Optional: AI summary via Replay Vision

If the user wants a deeper analysis without reading through events manually, offer a Replay Vision summary. Follow "check-then-scan" — don't scan blindly, a scanner can only observe a given session once.

  1. Check for an existing summary. A scheduled scanner may already have one:

    posthog:vision-observations-list
    {
      "session_id": "<session_id>"
    }

    The rows come back narrowed to id, session_id, status, summary_line and scanner_id. Look for one whose status is succeeded, then read it in full with vision-observations-get for that id: its scanner_snapshot.scanner_type tells you whether it is a summarizer, and scanner_result.model_output carries title, summary, intent, outcome, friction_points and keywords. If you find one, you are done — no new scan needed.

  2. Generate one with an inline scan of the built-in summary. It runs the same scan as the player's Summarize button, so a summary either of you started is shared, while a prompt of your own mints a separate scanner and a separate summary.

    posthog:vision-scanners-inline-scan
    {
      "session_ids": ["<session_id>"],
      "built_in": "summarize_recording"
    }

    Leave model out so the server default applies. Warn the user this is async and takes several minutes (rasterize + LLM). Nothing is scheduled and there is nothing to clean up: the scanner an inline scan mints never sweeps on its own. A 400 here usually means the organization has not approved AI data processing yet.

  3. Read results[0].scan_outcome before polling. started means poll vision-observations-list (step 1) until the new observation reaches succeeded. already_scanned means a terminal observation already exists — read it via step 1, and if its status is failed or ineligible say so rather than polling. A null scan_id or skipped_quota means nothing ran: report the quota, do not poll.

The project already has a summarizer scanner

Use an inline scan for a one-off summary even then. Only reach for a saved scanner when the user wants that scanner's own prompt rather than the built-in one:

posthog:vision-scanners-list
{
  "scanner_type": "summarizer"
}

Show the user the scanners (name + prompt), ask which to use, then run it against the session and poll vision-observations-list until the observation reaches succeeded:

posthog:vision-scanners-scan-session
{
  "id": "<scanner_id>",
  "session_id": "<session_id>"
}

Never create a scanner to answer a single question — vision-scanners-create leaves a scheduled sweep behind that the inline scan does not.

Tips

  • Run steps 1-3 in parallel when possible — they're independent queries.

  • If the recording has very few events, the session was likely very short. Note this rather than suggesting something is broken.

  • Console error count from the recording metadata is a good signal for whether to dig into exceptions. If it's 0, skip step 3.

  • The start_url from the recording tells you where the user's journey began — use this to frame the narrative.

  • If person is null on the recording, the user was anonymous. Person properties won't be available, but events still are.

  • finding-sessions-to-watch — choose which sessions are worth investigating in the first place

  • finding-replay-for-issue — start from an error tracking issue and find its linked recordings

  • diagnosing-missing-recordings — when a recording that should exist doesn't

  • creating-replay-vision-scanners — automate this kind of watching as a scheduled scanner

Files

SKILL.md

Investigating a session recording

When a user asks "what happened in this session?" or provides a recording/session ID to investigate, gather all relevant context in parallel rather than making them ask for each piece.

Available tools

ToolPurpose
posthog:session-recording-getRecording metadata (duration, counts, status)
posthog:persons-retrievePerson profile (properties, distinct IDs)
posthog:execute-sqlQuery events, errors, and page views in session
posthog:query-error-tracking-issues-listFind error tracking issues linked to the session
posthog:vision-observations-listCheck for an existing Replay Vision AI summary
posthog:vision-observations-getRead one observation in full (scanner_result)
posthog:vision-scanners-inline-scanGenerate an AI summary of the session (slow, optional)
posthog:vision-scanners-listFind saved summarizer scanners (scanner_type=summarizer)
posthog:vision-scanners-scan-sessionRun a saved summarizer scanner on the session (slow)

Workflow

Step 1 — Get recording metadata and person profile

Start with the recording to get metadata and the person's distinct ID:

posthog:session-recording-get
{
  "id": "<session_id>"
}

The recording id and the event $session_id are the same value. It selects the recording here and the same-session events in Step 2. The response includes distinct_id, person, start_time, end_time, duration, interaction counts, console error counts, and viewing status. Use the distinct_id to fetch the full person profile:

posthog:persons-retrieve
{
  "id": "<person_uuid_from_recording>"
}
Step 2 — Query same-session events

Use the recording id from Step 1 as the $session_id value. Get the timeline of what the user did during the session:

posthog:execute-sql
SELECT
    timestamp,
    event,
    properties.$current_url AS url,
    properties.$browser AS browser,
    properties.$os AS os,
    properties.$device_type AS device_type,
    properties.$screen_width AS screen_width
FROM events
WHERE $session_id = '<session_id>'
ORDER BY timestamp ASC
LIMIT 200

For sessions with many events, focus on the most informative ones:

posthog:execute-sql
SELECT
    timestamp,
    event,
    properties.$current_url AS url,
    if(event = '$exception', properties.$exception_values[1], null) AS exception_message,
    if(event = '$exception', properties.$exception_types[1], null) AS exception_type
FROM events
WHERE $session_id = '<session_id>'
    AND event IN ('$pageview', '$pageleave', '$autocapture', '$exception', '$rageclick')
ORDER BY timestamp ASC
LIMIT 100
No rows? Recover the event session ID

The recording id is the session ID. No rows means the session's events were ingested without it. Find candidates from the person's events in the recording window, padded by 100 seconds like the replay events query. person_id covers all of the person's distinct IDs:

posthog:execute-sql
SELECT
    properties.$session_id AS session_id,
    count() AS event_count,
    min(timestamp) AS first_seen,
    max(timestamp) AS last_seen
FROM events
WHERE person_id = '<person_uuid>'
    AND timestamp >= toDateTime('<start_time>') - INTERVAL 100 SECOND
    AND timestamp <= toDateTime('<end_time>') + INTERVAL 100 SECOND
    AND properties.$session_id IS NOT NULL
GROUP BY session_id
ORDER BY event_count DESC
LIMIT 10

Continue only when one session ID clearly matches. Use it for the Step 2 and Step 3 queries only. The replay URL and all Replay Vision calls take the recording id.

Step 3 — Check for linked error tracking issues

If the recording has console errors or exceptions, find related error tracking issues:

posthog:execute-sql
SELECT DISTINCT
    properties.$exception_fingerprint AS fingerprint,
    properties.$exception_types[1] AS type,
    properties.$exception_values[1] AS message,
    count() AS occurrences
FROM events
WHERE $session_id = '<session_id>'
    AND event = '$exception'
GROUP BY fingerprint, type, message
ORDER BY occurrences DESC
LIMIT 10

If fingerprints are found, search for the corresponding error tracking issues to provide links and status:

posthog:query-error-tracking-issues-list
{
  "searchQuery": "<exception_type or message>"
}
Step 4 — Synthesize the investigation

Present the findings as a coherent narrative:

  1. Who — person properties (name, email, country, plan, etc.)

  2. What — sequence of pages visited and key actions taken

  3. Problems — exceptions, console errors, rage clicks, and their frequency

  4. Related issues — linked error tracking issues with their status (active/resolved)

  5. Context — session duration, device/browser, activity score

Optional: AI summary via Replay Vision

If the user wants a deeper analysis without reading through events manually, offer a Replay Vision summary. Follow "check-then-scan" — don't scan blindly, a scanner can only observe a given session once.

  1. Check for an existing summary. A scheduled scanner may already have one:

    posthog:vision-observations-list
    {
      "session_id": "<session_id>"
    }

    The rows come back narrowed to id, session_id, status, summary_line and scanner_id. Look for one whose status is succeeded, then read it in full with vision-observations-get for that id: its scanner_snapshot.scanner_type tells you whether it is a summarizer, and scanner_result.model_output carries title, summary, intent, outcome, friction_points and keywords. If you find one, you are done — no new scan needed.

  2. Generate one with an inline scan of the built-in summary. It runs the same scan as the player's Summarize button, so a summary either of you started is shared, while a prompt of your own mints a separate scanner and a separate summary.

    posthog:vision-scanners-inline-scan
    {
      "session_ids": ["<session_id>"],
      "built_in": "summarize_recording"
    }

    Leave model out so the server default applies. Warn the user this is async and takes several minutes (rasterize + LLM). Nothing is scheduled and there is nothing to clean up: the scanner an inline scan mints never sweeps on its own. A 400 here usually means the organization has not approved AI data processing yet.

  3. Read results[0].scan_outcome before polling. started means poll vision-observations-list (step 1) until the new observation reaches succeeded. already_scanned means a terminal observation already exists — read it via step 1, and if its status is failed or ineligible say so rather than polling. A null scan_id or skipped_quota means nothing ran: report the quota, do not poll.

The project already has a summarizer scanner

Use an inline scan for a one-off summary even then. Only reach for a saved scanner when the user wants that scanner's own prompt rather than the built-in one:

posthog:vision-scanners-list
{
  "scanner_type": "summarizer"
}

Show the user the scanners (name + prompt), ask which to use, then run it against the session and poll vision-observations-list until the observation reaches succeeded:

posthog:vision-scanners-scan-session
{
  "id": "<scanner_id>",
  "session_id": "<session_id>"
}

Never create a scanner to answer a single question — vision-scanners-create leaves a scheduled sweep behind that the inline scan does not.

Tips

  • Run steps 1-3 in parallel when possible — they're independent queries.

  • If the recording has very few events, the session was likely very short. Note this rather than suggesting something is broken.

  • Console error count from the recording metadata is a good signal for whether to dig into exceptions. If it's 0, skip step 3.

  • The start_url from the recording tells you where the user's journey began — use this to frame the narrative.

  • If person is null on the recording, the user was anonymous. Person properties won't be available, but events still are.

  • finding-sessions-to-watch — choose which sessions are worth investigating in the first place

  • finding-replay-for-issue — start from an error tracking issue and find its linked recordings

  • diagnosing-missing-recordings — when a recording that should exist doesn't

  • creating-replay-vision-scanners — automate this kind of watching as a scheduled scanner

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
PostHog
Publisher
PostHog (Official)
Source
PostHog/skills · skills/omnibus/investigating-replay · commit a5d30e7
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by PostHog or PostHog.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download investigating-replay.zip