finding-replay-for-issue
它能做什么
本技能从可能多达数百段的录制中,为某个错误追踪问题挑选最有用的会话录制。适合希望观看缺陷发生前情况的开发者和支持人员。
适用场景
- ✓当你想观看能展示导致某个错误的经过的回放时。
- ✓当某个错误关联了数百段录制,而你不知道该看哪一段时。
- ✓当你想获得用户在出错前所做事情的简短摘要的时候。
技能链接
https://github.com/PostHog/posthog/blob/master/products/replay/skills/finding-replay-for-issue/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为这个错误问题找出最佳的会话回放,并告诉我用户在出错前做了什么。”
每周 5 个新技能,1 分钟读完。
工作原理
它会按近期程度、活跃度以及用户旅程的完整性,对关联到该错误的会话进行排序。然后,它会检查是否已有 AI 摘要,必要时可以生成一份。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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.
Available tools
| Tool | Purpose |
|---|---|
posthog:query-error-tracking-issue |
Get issue details (fingerprint, status, volume) |
posthog:execute-sql |
Query exception events to find linked sessions |
posthog:query-session-recordings-list |
Fetch recording metadata for candidate sessions |
posthog:session-recording-get |
Get full details for the selected recording |
posthog:vision-observations-list |
Check for an existing Replay Vision AI summary |
posthog:vision-scanners-list |
Find summarizer scanners (scanner_type=summarizer) |
posthog:vision-scanners-scan-session |
Run a summarizer scanner on the recording (optional, slow) |
Workflow
Step 1 — Get the issue details
Fetch the error tracking issue to understand what you're looking for:
posthog:query-error-tracking-issue
{
"issueId": "<issue_id>"
}
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:
posthog:query-session-recordings-list
{
"session_ids": ["<id1>", "<id2>", "<id3>", ...],
"date_from": "-30d"
}
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_secondstorecording_duration. A 20-minute recording with 10 seconds of activity is mostly idle tabs — the user walked away. Prefer sessions whereactive_seconds / recording_durationis above 0.3 (30%). - Activity score — higher
activity_scoremeans the user was actively interacting, not idle. More interesting to watch. - Recency — more recent sessions reflect current app behavior.
Step 4 — Present the finding
Fetch full details for the selected recording:
posthog:session-recording-get
{
"id": "<best_recording_id>"
}
Present to the user:
- The recording with a link to watch it
- 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
urlandfirst_seencolumns) - 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:
posthog:vision-observations-list { "session_id": "<best_recording_id>" }If an observation has
scanner_snapshot.scanner_typesummarizerand
常见问题
为什么不直接选第一段会话?
许多关联的会话是很短的崩溃片段或重复记录,因此本技能会对它们排序,以找出最有用的一段。
它需要已有的摘要吗?
不需要。它会检查是否已有摘要,也可以对录制运行摘要扫描,但速度较慢。
哪些因素决定最佳回放?
近期程度、活跃度,以及出错前用户旅程的完整性。
详情
作者的原始描述
Finds the most informative session recording linked to an error tracking issue. Use when a user has an error tracking issue ID and wants to watch a replay showing what the user was doing when the error occurred. Ranks linked sessions by recency, activity score, and journey completeness, then summarizes the pre-error context. Replaces blind session picking from potentially hundreds of linked recordings.
repo: PostHog/posthog
热度
- GitHub 星标
- 41k
- 排名
- #6907
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
depot-ci
41k帮你的智能体设置并运行 Depot CI 工作流(GitHub Actions 的替代方案),包括迁移现有工作流和读取运行日志。
depot-container-builds
41k帮你的智能体在 Depot 的远程构建器上构建 Docker 镜像,包括多平台镜像、推送到镜像仓库,以及修复构建失败。
depot-github-runners
41k帮你的智能体把 GitHub Actions 任务迁移到 Depot 托管的运行器上,选择运行器规格和标签,并排查运行器设置问题。
editing-agents-md
41k帮你的智能体判断某条规则应写入 AGENTS.md 还是 CLAUDE.md,并以不会让文件臃肿的方式写下,确保规则真正生效。