/analyzing-experiment-session-replays
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
$ npx -y skills add posthog/posthog --skill analyzing-experiment-session-replays --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/analyzing-experiment-session-replays
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
analyzing-experiment-session-replays.SKILL.mdname: 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.'
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:
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:
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`):
{
"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
Example interaction
User: "How are users behaving in my chec
Read more
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.'
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:
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:
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`):
{
"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
Example interaction
User: "How are users behaving in my chec
:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Repo: posthog/posthog
Other skills on posthog.
- /analyzing-expensive-users
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.
Open skill - /creating-online-evaluations
Author continuously-running online evaluations in PostHog AI observability, grounded in real failure modes you've identified. Use when the user wants evaluations that automatically score new generations or whole traces going forward — "create an eval to catch X", "continuously
Open skill - /exploring-ai-failures
Find where an AI/LLM application is failing in production and surface the failure patterns, working from real traces. Use when someone wants to understand what's going wrong with an AI feature, find and categorize failure modes, triage errors, or investigate quality issues
Open skill - /exploring-llm-clusters
Investigate AI observability clusters — understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into individual traces within clusters.
Open skill - /exploring-llm-costs
Investigate LLM spend in PostHog — total cost over time, cost by model, provider, user, trace, or custom dimension, token and cache-hit economics, and cost regressions. Use when the user asks "how much are we spending on LLMs?", "which model / user / feature is most expensive?",
Open skill - /exploring-llm-evaluations
Investigate AI observability evaluations — `hog` (deterministic code-based), `llm_judge` (LLM-prompt-based), and `sentiment` (user-message sentiment). Find existing evaluations, inspect their configuration, run them against specific generations, query individual results, and
Open skill

