Agent Native

analyzing-experiment-session-replays

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

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

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

Generated summary from the skill's own text

This skill enables agents to analyze session recordings from experiment variants to identify behavioral differences between control and test groups. It guides retrieval of experiment metadata, construction of recording filters for each variant, and comparison of user interaction patterns to surface usability issues and qualitative insights that complement quantitative experiment results.

When to use it

  • User wants to compare how people interact with control versus test variants
  • Need to identify usability friction or confusion in experiment variants
  • Want qualitative insights beyond experiment metrics and statistical results
  • User asks to review session replays for a specific experiment variant

When not to

  • Experiment is still in draft state and hasn't started yet
  • Session replay is not enabled for the project
  • Only quantitative analysis of experiment results is needed

Install

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

skills CLI

npx skills add posthog/posthog --skill analyzing-experiment-session-replays

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 analyzing-experiment-session-replays@244c70d066c0b441e3b8cc6875f914c5e09c42b3

Installs the commit we checked (244c70d).

Copy by hand

Download the folder at 244c70d and put it in .claude/skills/analyzing-experiment-session-replays for Claude Code and in .agents/skills/analyzing-experiment-session-replays 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 "analyzing-experiment-session-replays" by PostHog.

Source, pinned to commit 244c70d066c0b441e3b8cc6875f914c5e09c42b3:
https://github.com/posthog/posthog/tree/244c70d066c0b441e3b8cc6875f914c5e09c42b3/products/experiments/skills/analyzing-experiment-session-replays

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/analyzing-experiment-session-replays/ for Claude Code and .agents/skills/analyzing-experiment-session-replays/ 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/analyzing-experiment-session-replays-posthog

SKILL.md at the pin

---
name: analyzing-experiment-session-replays
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.'
---

# Analyzing experiment session replays

This skill guides you through analyzing session recordings for experiment variants to understand behavioral differences between control and test groups.

## When to use this skill

Use this skill when:

- The user asks to analyze session replays for an experiment
- The user wants to understand how users behave differently across experiment variants
- The user asks to compare user behavior between control and test variants
- The user wants qualitative insights to complement experiment metrics
- The user asks questions like "How are users behaving in my experiment?" or "Show me session replays for variant X"

## Prerequisites

Before analyzing session replays:

1. The experiment must be **launched** (not in draft state)
2. Session replay must be enabled for the project
3. Users must have been exposed to the experiment variants
4. The experiment must have a start date

## Workflow

### 1. Get experiment details and feature flag variants

First, retrieve the experiment information and the feature flag variants (source of truth).

**Step 1a: Get experiment metadata**

You can either:

- **Option A**: Use the `experiment-get` tool if you already have the experiment ID from context
- **Option B**: Query the experiments table via HogQL:

```sql
SELECT
    e.id,
    e.name,
    f.key AS feature_flag_key,
    e.start_date,
    e.end_date
FROM system.experiments e
JOIN system.feature_flags f ON f.id = e.feature_flag_id
WHERE e.id = <experiment_id>
```

From the experiment data, extract:

- `feature_flag_key`: The feature flag controlling the experiment
- `start_date` and `end_date`: The experiment's time range

**Step 1b: Get variants from the feature flag**

**IMPORTANT**: Always get variants from the feature flag, NOT from `experiment.parameters.feature_flag_variants`.
The parameters can be out of sync or deprecated. The feature flag is the source of truth.

Query the feature flag to get the current variants:

```sql
SELECT filters.multivariate.variants AS variants
FROM system.feature_flags
WHERE key = '<feature_flag_key>'
```

Select the variants path directly — selecting the whole `filters` object gets truncated in results for flags with large targeting configs.
Example structure: `[{"key": "control", "name": "Control", "rollout_percentage": 50}, {"key": "test", ...}]`

The variant `key` values (e.g., "control", "test", "variant_a") are what you'll use to filter session recordings.

### 2. Build session recording filters for each variant

For each variant in the experiment, construct recording filters that match users exposed to that variant.

**Filter structure for a variant** (input to `query-session-recordings-list`):

```json
{
  "date_from": "<experiment.start_date>",
  "date_to": "<experiment.end_date or current time>",
  "filter_test_accounts": true,
  "properties": [
    {
      "type": "event",
      "key": "$feature/<feature_flag_key>",
      "operator": "exact",
      "value": ["<variant_key>"]
    }
  ]
}
```

**Key points:**

- The `$feature/<flag_key>` event property records the flag's value on each event — filtering on it matches recordings where the flag was active with that variant. This is an approximation of exposure, broader than the experiment's exposure event (`$feature_flag_called`, or `$experiment_exposure` on the new rollout — both deduped per identity): right for browsing behavior across variants, but not an exact mirror of the analysis population — the `scanning-experiments-with-replay-vision` skill derives that exact filter when you need it
- `value` is an array of variant key strings (e.g. `["control"]`); for boolean flags use `["true"]` or `["false"]`
- Avoid the `type: "flag"` / `flag_evaluates_to` property filter for variant scoping — the recordings query accepts it but silently ignores it, returning unfiltered results (last verified 2026-06-10). If you want to try it anyway, verify it actually filters first: a query with a nonexistent flag key should return zero recordings
- Set the date range to the experiment's start and end dates
- Enable `filter_test_accounts: true` to exclude test users

### 3. Retrieve recordings for each variant

Use the `query-session-recordings-list` tool with the filters constructed in step 2.

Call the tool once per variant to get recordings for each group:

- Variant "control" → recordings for control group
- Variant "test" → recordings for test variant
- Additional variants if the experiment has more than 2

The tool returns a list of recordings with metadata including:

- `distinct_id` — the person's distinct ID
- `recording_duration`, `active_seconds`, `inactive_seconds`
- `click_count`, `keypress_count`, `mouse_activity_count`
- `console_log_count`, `console_warn_count`, `console_error_count`
- `start_url` — first page URL visited
- `start_time` / `end_time`, `activity_score`

### 4. Compare and analyze

Compare the recordings between variants by looking for:

**Quantitative patterns:**

- Session duration differences
- Activity levels (clicks, keypresses)
- Console error rates
- Bounce rates

**Qualitative insights:**

- User confusion or frustration indicators
- Different navigation paths
- Feature discovery patterns
- Error recovery behavior

### 5. Present findings

Summarize the behavioral differences between variants, highlighting:

- Total recordings per variant
- Notable behavior patterns unique to each variant
- Usability issues or friction points observed
- Recommendations based on the qualitative data

### 6. Observing shows behavior; asking adds what users think of it

Watching sessions and asking users are different instruments, not substitutes. Recordings show what people
did with the change; a short survey, shown when they finish the experimented flow, captures what they
thought of it — a rating and an optional comment, readable per variant. For a user-facing change of real size, the two
together make a fuller qualitative read than either alone, so mention the option when the behavioral
comparison in step 4 leaves opinion unaccounted for, or when a pattern in the recordings is a hypothesis
worth checking with the people who produced it. Once per conversation at most; drop it if declined.

Default to asking every exposed user rather than one variant: a popover shown to only one arm is itself a
difference between the arms, and the response event carries the variant anyway, so the split survives.

→ See [`references/qualitative-feedback.md`](../diagnosing-experiment-health/references/qualitative-feedback.md) in [[diagnosing-experiment-health]]

## Example interaction

```text
User: "How are users behaving in my checkout experiment?"
Agent steps:
1. Query experiment details (ID: 123, feature_flag_key: "checkout-flow-test", date range: 2025-01-01 to 2025-01-31)
2. Query feature flag "checkout-flow-test" to get variants from filters.multivariate.variants
3. Extract variant keys: "control" and "new-checkout"
4. Build filters for control variant:
   - Property filter: { type: "event", key: "$feature/checkout-flow-test", operator: "exact", value: ["control"] }
   - Date range: 2025-01-01 to 2025-01-31
5. Call query-session-recordings-list with control filters → 147 recordings found
6. Build filters for new-checkout variant and call query-session-recordings-list → 152 recordings found
7. Compare patterns:
   - Control: Average 3m 45s session duration, 12% console errors
   - New-checkout: Average 2m 30s session duration, 5% console errors
8. Present findings:
   "I analyzed session replays for your checkout experiment. The new checkout flow shows:
   - 33% faster completion (2m 30s vs 3m 45s)
   - 58% fewer console errors (5% vs 12%)
   - Users in the new variant navigate directly to payment, while control users often backtrack to review cart
   - Recommendation: The new checkout flow reduces friction and errors"
```

## Important notes

**Do not make assumptions:**

- Always verify the experiment has recordings before analyzing
- Check that the experiment is launched (has a start_date)
- If no recordings are found, inform the user clearly

**Filter construction:**

- The `$feature/<flag_key>` event property is how you scope recordings to a variant
- One filter per variant — call the tool once per variant with its own filter
- For boolean flags, use `["true"]`/`["false"]` as the value instead of a variant key

**Error handling:**

- If the experiment is in draft state, tell the user it hasn't started yet
- If no recordings exist, suggest enabling session replay or waiting for user traffic
- If the variant count is unexpected, double-check the experiment configuration

## Related tools

- `query-session-recordings-list`: Core tool for retrieving session recordings with filters
- `experiment-get`: Get experiment metadata; `experiment-results-get` for statistical results
- `execute-sql`: Query experiments table for details via HogQL

## Related skills

- **`diagnosing-experiment-health`** — the quantitative side: bias checks and significance on the same experiment
- **`investigating-replay`** — deep-dive a single session from either variant
- **`finding-sessions-to-watch`** — general session shortlisting outside the experiment context

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

  • configuring-experiment-analytics

    Configures how PostHog measures experiment impact by setting exposure criteria (who counts in the analysis), choosing metrics to track (mean, funnel, ratio…

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

  • data-table-manager

    This skill manages n8n Data Tables through creation, import, querying, and mutation operations.

    by n8nOfficial publisher

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

  • algolia-automation

    This skill automates Algolia search and indexing operations through the Rube MCP interface.

    by ComposioOfficial publisher

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

  • expo-sqlite

    This skill enables SQLite database operations in Expo and React Native apps for structured data storage, offline queues, and persistent caches.

    by ExpoOfficial publisher

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

  • prisma-8

    This skill helps agents work with Prisma 8, a contract-first data layer for TypeScript projects.

    by PrismaOfficial publisher

    Contains scripts

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

  • configuring-experiment-rollout

    Configures variant split and overall rollout percentage for PostHog experiments, determining who sees which test variant and what percentage of users enter…

    by PostHogOfficial publisher

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

  • debugging-failed-data-quality-checks

    This skill debugs failed or errored data quality checks by examining their run history, displaying matching rows, and identifying root causes in either the…

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.9K 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