Agent Native

investigating-replay

Gathers session recording metadata, user profile, event timeline, and linked error issues in parallel to give a complete investigation when a user provides a…

by PostHogOfficial publisherNot reviewed

Identity proven by GitHub's verified organisation badge (PostHog)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
License
MIT (permissive)
Pin
244c70dpinned Oct 9, 2026
Context cost
about 2,300 tokenswhen the skill loads
GitHub stars
40,191on posthog/posthog
Scripts
None found

What it does

“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 author's description, from SKILL.md

Generated summary from the skill's own text

Gathers session recording metadata, user profile, event timeline, and linked error issues in parallel to give a complete investigation when a user provides a session ID. Combines data from PostHog's recordings, persons, events, and error tracking tools into a coherent narrative about what happened during a user session.

When to use it

  • User provides a session ID and wants to understand what occurred
  • Need to diagnose errors or unexpected behavior within a single session
  • Investigating user activity across pages, actions, and errors together
  • Combining session context with person profile and related issues

When not to

  • Looking for sessions matching criteria across multiple users
  • Creating scheduled automated session analysis
  • Needing custom analysis logic beyond standard investigation flow

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add posthog/posthog --skill investigating-replay

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install posthog/posthog investigating-replay@244c70d066c0b441e3b8cc6875f914c5e09c42b3

Installs the commit we checked (244c70d).

Copy by hand

Download the folder at 244c70d and put it in .claude/skills/investigating-replay for Claude Code and in .agents/skills/investigating-replay for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at 244c70d

Claude Code plugin

/plugin install posthog@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "investigating-replay" by PostHog.

Source, pinned to commit 244c70d066c0b441e3b8cc6875f914c5e09c42b3:
https://github.com/posthog/posthog/tree/244c70d066c0b441e3b8cc6875f914c5e09c42b3/products/replay/skills/investigating-replay

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/investigating-replay/ for Claude Code and .agents/skills/investigating-replay/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/posthog/investigating-replay-posthog

SKILL.md at the pin

---
name: investigating-replay
description: >
  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.
---

# 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

| Tool                                       | Purpose                                                    |
| ------------------------------------------ | ---------------------------------------------------------- |
| `posthog:session-recording-get`            | Recording metadata (duration, counts, status)              |
| `posthog:persons-retrieve`                 | Person profile (properties, distinct IDs)                  |
| `posthog:execute-sql`                      | Query events, errors, and page views in session            |
| `posthog:query-error-tracking-issues-list` | Find error tracking issues linked to the session           |
| `posthog:vision-observations-list`         | Check for an existing Replay Vision AI summary             |
| `posthog:vision-observations-get`          | Read one observation in full (`scanner_result`)            |
| `posthog:vision-scanners-inline-scan`      | Generate an AI summary of the session (slow, optional)     |
| `posthog:vision-scanners-list`             | Find saved summarizer scanners (`scanner_type=summarizer`) |
| `posthog:vision-scanners-scan-session`     | Run 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:

```json
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:

```json
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:

```sql
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:

```sql
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:

```sql
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:

```sql
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:

```json
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:

   ```json
   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. Pass this exact config: inline scans are
   keyed by a fingerprint of the whole config, so the config below reuses the same
   scanner row the player's Summarize button uses on its built-in prompt, while a
   different prompt or `length` mints a separate scanner and a separate summary.

   ```json
   posthog:vision-scanners-inline-scan
   {
     "session_ids": ["<session_id>"],
     "scanner_type": "summarizer",
     "prompt": "Summarize what the user did in this session: which pages they visited, what they tried to accomplish, and any notable moments like errors, confusion, or successful completions. Be concrete and don't speculate.",
     "scanner_config": { "length": "medium" }
   }
   ```

   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:

```json
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`:

```json
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.

## Related skills

- **`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

From posthog/posthog at 244c70d, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at 244c70d

Files

1 file, 9.8 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 244c70d

Also in

The same SKILL.md content appears in these places too. We list it once and credit the oldest public source.

All 50 skills from PostHog

More from PostHog

  • analyzing-experiment-session-replays

    This skill enables agents to analyze session recordings from experiment variants to identify behavioral differences between control and test groups.

    Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago

  • analyzing-offline-evaluations

    This skill inspects and compares offline AI evaluation experiments stored in PostHog, diagnoses case-level regressions, and tracks scorer changes across…

    Claude Code, Codex, Cursor +4 · about 1.5K tokens · pinned 6 days ago

  • auditing-warehouse-view-health

    Audits materialized views in a PostHog data warehouse to identify failed views and flag unused ones that waste compute resources.

    Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 6 days ago

  • authoring-data-quality-checks

    This skill adds data quality checks (like dbt tests) on warehouse tables, views, and HogQL metrics, supporting assertions such as not-null, uniqueness…

    Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 6 days ago

  • authoring-scouts

    This skill helps engineers write, edit, and adapt PostHog Signals scouts, scheduled agents that scan projects and report findings to an inbox.

    Claude Code, Codex, Cursor +4 · about 10.6K tokens · pinned 6 days ago

  • building-a-dashboard

    This skill constructs or modifies PostHog dashboards by selecting and arranging insight tiles.

    Claude Code, Codex, Cursor +4 · about 2.1K tokens · pinned 6 days ago

All Observability skills
  • debugging-executions

    Debug workflow execution failures by inspecting failed nodes, re-running executions, and comparing expected versus actual values.

    by n8nOfficial publisher

    Claude Code, Codex, Cursor +3 · about 2.5K tokens · pinned 6 days ago

  • instance-awareness

    This skill teaches the agent to resolve ambiguous requests by reading the instance's activity log and workflow history instead of asking the user to clarify.

    by n8nOfficial publisher

    Claude Code, Codex, Cursor +3 · about 1.3K tokens · pinned 6 days ago

  • creating-replay-vision-scanners

    Guides agents through creating Replay Vision scanners, LLM probes that watch session recordings on a schedule and log findings as observations.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 6 days ago

  • exploring-replay-vision-observations

    This skill guides agents through reading observations from Replay Vision scanners, understanding their findings across session recordings, and taking action…

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 6 days ago

  • exploring-scouts

    Explore and understand PostHog Signals scouts through read-only tools, examining fleet configuration, recent runs, performance metrics, and durable team…

    by PostHogOfficial publisher

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 11K tokens · pinned 6 days ago

  • resolving-ingestion-warnings

    This skill diagnoses and resolves PostHog ingestion warnings that occur during event processing.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 6.8K tokens · pinned 6 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use