skills/debugging-local-replay/SKILL.md
Debugs why session recordings aren't appearing in the local dev environment. Use when a developer reports that local replay ingestion isn't working, recordings aren't showing up despite /s calls, or the replay pipeline seems broken after hogli start. Covers the full local pipeline: SDK capture, Caddy proxy, capture-replay (Rust), Kafka, ingestion-sessionreplay (Node), recording-api (Node), SeaweedFS, and common failure modes like orphaned processes, stuck phrocs workers, and trigger misconfiguration.
npx skillsauth add posthog/ai-plugin debugging-local-replayInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When a developer says "local replay isn't working" or "recordings aren't showing up", work through these layers in order. The local replay pipeline has several moving parts and failures are usually silent.
| Symptom | Likely cause |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
| No /s calls in Network tab | SDK not recording — triggers, settings, or recorder script issue (Step 1) |
| /s calls return 200 but no recordings in list | Ingestion pipeline broken — capture-replay, Kafka, or ingestion-sessionreplay (Steps 2-3) |
| Recordings listed but playback stuck on "Buffering..." | recording-api (port 6741) not running (Step 2) |
| Recorder script MIME type or CORS error in console | Frontend build stale — need pnpm build + pnpm copy-scripts (Step 1) |
Browser SDK → /s endpoint (Caddy proxy :8000)
→ capture-replay (Rust, :3306)
→ Kafka (session_recording_snapshot_item_events topic)
→ ingestion-sessionreplay (Node, :6740, PLUGIN_SERVER_MODE=recordings-blob-ingestion-v2)
→ SeaweedFS (blob storage, :8333)
→ recording-api (Node, :6741, PLUGIN_SERVER_MODE=recording-api)
→ Frontend
A break at any point in this chain means no recordings in the UI. The diagnostic approach is to find where the chain breaks.
Ask the developer to open browser DevTools Network tab and filter for /s.
If no /s calls at all:
The SDK isn't attempting to send recording data. Investigate client-side causes:
$replay_sample_rate is < 1.0, sessions may be sampled out.session_recording must not be explicitly disabled.http://localhost:8000 (or wherever
the local Caddy proxy is running)./s endpoint.MIME type ('text/html') is not executable for posthog-recorder.js or a CORS error for
lazy-recorder.js. This means Django is serving an HTML page (usually the login redirect)
instead of the JS file — the static recorder scripts are stale or missing.
See recorder script build failure.If /s calls are happening with 200 responses:
The SDK is recording and capture is receiving data. The break is downstream — proceed to Step 2.
If /s calls are returning errors (4xx/5xx):
The capture service may be down or misconfigured. Check capture-replay in phrocs.
Check that these phrocs processes are running and healthy.
A "running" process that never produced output after tsx watch src/index.ts is effectively dead.
| Process | Port | What it does |
| ------------------------- | ---- | ------------------------------------------------ |
| capture-replay | 3306 | Rust service receiving /s, writes to Kafka |
| ingestion-sessionreplay | 6740 | Node consumer processing recordings from Kafka |
| recording-api | 6741 | Node service serving replay data to the frontend |
Verify with:
lsof -nP -i :3306 -i :6740 -i :6741
If ports are not listening: The processes haven't started or are stuck. See common failures.
If ports are listening: The pipeline processes are running. Proceed to Step 3.
These Docker containers must be running and healthy:
| Container | Purpose |
| ---------------------- | -------------------------------- |
| posthog-kafka-1 | Message bus for recording events |
| posthog-db-1 | Postgres for metadata |
| posthog-redis7-1 | Redis for state |
| posthog-clickhouse-1 | ClickHouse for session data |
| seaweedfs-main | Blob storage for recording data |
Check with:
docker ps --format "table {{.Names}}\t{{.Status}}" | grep -E "kafka|db|redis7|clickhouse|seaweed"
All should show (healthy) except seaweedfs which doesn't have a health check.
If seaweedfs-main is missing, the replay Docker profile may not be active —
check the docker-compose phrocs process output for --profile replay.
If capture-replay is running and receiving /s calls, data should land on the
session_recording_snapshot_item_events Kafka topic. Check the Kafka UI at
http://localhost:8080 (if the debug_tools intent is enabled) or use kcat:
kcat -b localhost:9092 -t session_recording_snapshot_item_events -C -c 5 -e
If the topic is empty or doesn't exist: capture-replay isn't writing to Kafka. Check its phrocs logs for Kafka connection errors.
If data is on the topic but recordings don't appear: ingestion-sessionreplay isn't consuming. Check if it's stuck, crashed, or if an orphaned process is holding the consumer group (see common failures).
Ingestion writes recording blobs to SeaweedFS. Verify it's accessible:
curl -s http://localhost:8333/ | head -5
The SESSION_RECORDING_V2_S3_ENDPOINT env var must be set correctly.
In bin/start, this defaults to http://seaweedfs:8333 (the Docker hostname).
Host processes resolve this via Docker networking.
See common failures for detailed diagnosis of:
bin/wait-for-dockerdata-ai
Signals scout for PostHog Tasks, the agent work items a project runs. Two lenses: delivery health (runs failing, clustered by repository and error class, and retry storms) every run, and on a slower rotation demand (recurring asks across human-authored tasks that point at a product gap). Skips the scout fleet's own run rows.
devops
Signals scout for the PostHog Conversations (support inbox) product. Watches the `$conversation_*` ticket-lifecycle events for support-delivery regressions — SLA breach-rate steps, first-response latency blowouts, backlog inflow-vs-resolution imbalance, and channel / assignment concentration — and files each dated regression as a report. Complements the per-ticket product-feedback signals the emission pipeline already fires; does not re-surface individual ticket content.
development
Populates and maintains a project's data catalog (semantic layer): canonical metrics, trust marks (certifications) on warehouse tables/views, and reviewed table relationships. Use when asked to set up / seed / bootstrap the data catalog or semantic layer, to catalog a project's metrics, to certify or deprecate data sources, to propose or review table joins, or to work through the proposal review queue. To *use* an existing catalog to answer a business-number question, see querying-posthog-data instead. Trigger terms: data catalog, semantic layer, canonical metric, certify table, deprecate source, relationship proposal, metric drift, review queue.
tools
Investigate logs in a PostHog project: verify a service or deployment is healthy, explain an error spike, triage an incident, or understand what a log stream is saying. Use when the user asks to "check the logs", asks whether a service, deploy, release, or change is working or broke anything, asks why errors are up or what changed, or wants the root cause of failures visible in logs. Routes the logs MCP tools (services overview, pattern mining, before/after pattern diffing, bucketed counts, facets, raw rows) so investigations start from summaries instead of raw rows or hand-written SQL over the logs table.