exporting-recordings-to-customer-s3
Skill733 starsChanged 6 days agoMITView on GitHub
Runs a paid, staff-triggered export of a team's session recordings into an S3 bucket the customer owns, with the export_recordings_to_s3 management command. Use when a customer needs recordings kept past retention (litigation, legal hold, forensics, compliance archive), when asked to quote, price, start, monitor or check an export of recordings to a customer's bucket, or when a customer asks how to play back an exported .phrec file. Covers the quote, the customer's IAM role and KMS setup, starting the run, monitoring it and handing over the result.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- PostHog/posthogword for word, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 1
- PostHog/posthog★ 41k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository131 other files it gives its agents.
- AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- hog/AGENTS.mdAGENTS.md
- proto/AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- .cursor/rules/django-python.mdcCursor rule
- .cursor/rules/react-typescript.mdcCursor rule
- .cursor/rules/rust.mdcCursor rule
- adding-activity-loggingSkill
- adding-api-scopesSkill
- adding-dashboard-v2-custom-contentSkill
- adding-dashboard-v2-panel-typesSkill
- adding-inbound-webhooksSkill
- adding-inbox-sourcesSkill
- adding-ingestion-warningsSkill
- adding-mcp-store-serversSkill
- adding-personhog-rpcSkill
- adding-product-alertingSkill
- adding-project-secret-api-key-authSkill
- adding-today-highlightsSkill
- adopting-generated-api-typesSkill
- analyzing-experiment-precompute-canarySkill
- analyzing-experiment-query-performanceSkill
- analyzing-insights-across-teamsSkill
- announcing-behavior-changesSkill
- auditing-warehouse-source-coverageSkill
- authenticating-to-clickhouseSkill
- authoring-ci-workflowsSkill
- building-on-capture-v1Skill
- building-product-empty-statesSkill
- building-the-toolbarSkill
- calling-the-ai-gatewaySkill
- clickhouse-migrationsSkill
- creating-customer-analytics-account-widgetsSkill
- debugging-ci-failuresSkill
- debugging-local-replaySkill
- debugging-local-task-agent-runsSkill
- debugging-mcp-analyticsSkill
- debugging-signals-pipelineSkill
- debugging-table-access-deniedSkill
- depot-ciSkill
- depot-container-buildsSkill
- depot-github-runnersSkill
- developing-subscriptionsSkill
- developing-the-cliSkill
- django-migrationsSkill
- django-startup-timeSkill
- documenting-warehouse-sourcesSkill
- editing-agents-mdSkill
- establishing-code-ownershipSkill
- extending-hobby-smoke-testsSkill
- extending-personhog-test-harnessSkill
- extending-the-admin-consoleSkill
- fixing-flaky-testsSkill
- formatting-slack-messagesSkill
- gating-production-deploysSkill
- gating-sensitive-actionsSkill
- generating-clickhouse-query-performance-reportsSkill
- hogliSkill
- implementing-mcp-toolsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Read the export README first.
- Distinctive: line 22
Stop and ask the person you work for before you:
- Distinctive: line 24
Start an export: Only start one when a person confirms the customer accepted the quote and billing cleared it.
- Very specific: line 32
Run every command in a toolbox pod in the team's region (prod-us or prod-eu).
- Very specific: line 37
Run each command with kubectl exec <pod> -- python manage.py export_recordings_to_s3 ....
- Distinctive: line 71
Before the start, confirm with the person that the customer has:
- Distinctive: line 94
Keep the printed workflow ID.
- Distinctive: line 103
When a run is far slower than the quote's estimate, check worker CPU as the README's Throughput section describes before you suggest more …
- Very specific: line 110
Ask the person before you rerun them.
- Very specific: line 116
When the status is completed, summary.json is in the bucket under {prefix}/{team_id}/{run_id}/manifests/.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Exporting recordings to a customer's S3 bucket
Read the export README first. It explains the run, the bucket layout, the file format and what the customer sets up.
The export costs us real money and the customer pays for it. So the job has two halves with a person in between: quote, then wait for a go-ahead, then start.
Decisions that are not yours
Stop and ask the person you work for before you:
- Start an export. Only start one when a person confirms the customer accepted the quote and billing cleared it. A request to "export recordings for X" means quote first.
- Name a price or share the quote with anyone. The command prints our cost. Sales sets the price.
- Pass
--allow-cross-region. Cross-region transfer adds cost the customer must have agreed to. - Raise
--max-parallel-shardsabove the default on a large export. More shards load the session replay workers and recording-api harder, and they only go faster while the workers have room. Read Throughput before you suggest a value.
Where to run
Run every command in a toolbox pod in the team's region (prod-us or prod-eu).
The toolbox CLI claims one.
A toolbox pod has what the command needs: ClickHouse for the quote, object storage for quotes and session lists, and Temporal to start the workflow.
The shards run on the session replay workers, not in the pod.
Run each command with kubectl exec <pod> -- python manage.py export_recordings_to_s3 ....
For a session list, first copy the file into the pod with kubectl cp.
Steps
1. Pin down the selection
You need the team ID, the region (US or EU), the date range (UTC days, inclusive) and the bucket's AWS region. To export only some sessions in the range, you also need one of:
- a saved recordings filter (
--playlist <short id>), for a selection like "sessions that visited this URL" or "sessions from this country". Have the customer, or the person, build the filter in the recordings list and save it, so the customer sees exactly what they get. The short ID is in the filter's URL (savedFilterId=). The filter's own date range is ignored: the quote's range applies. - a file of session IDs (
--session-ids-file).
Filters on event properties, such as country, scan events over the whole range and can take minutes on a large team.
The quote saves the list of sessions it priced, and the run exports exactly that list. Sessions that arrive after the quote are not exported.
Each day is split into --shards-per-day shards (default 16), and a shard holds at most 100,000 sessions. When the quote names a shard that goes over, quote again with a higher --shards-per-day.
A session ID file or saved filter can select at most 1,000,000 sessions per quote. Split a larger selection by date range.
A session belongs to the day it started on.
The range must end before today (UTC). The command refuses a range that includes today.
Recordings past their retention are gone and cannot be exported.
2. Quote
python manage.py export_recordings_to_s3 --quote --team-id <id> --region <bucket region> \
--date-from <yyyy-mm-dd> --date-to <yyyy-mm-dd> [--playlist <short id> | --session-ids-file ids.txt]Report the quote ID, the session count, our cost, the estimated duration, the best-effort session count and the valid-until time. Best-effort sessions expire within days and may expire before their shard runs. Say so plainly. A quote is valid for 7 days. After that, quote again: more data moves to Glacier IR and the cost rises.
3. Check the customer's setup
Before the start, confirm with the person that the customer has:
- an IAM role whose ARN came from an admin of that customer's PostHog organization, not from an unverified sender, that trusts PostHog's recording-exports role for the region and requires the external ID
posthog-<organization id>(the README lists the ARNs), - a role that allows
s3:PutObjectands3:AbortMultipartUploadon the bucket and prefix, - for a KMS-encrypted bucket, KMS permissions on the role and a key policy that allows the role, plus the key ID or ARN (not an alias),
- the bucket in the same AWS account as the role,
- a lifecycle rule that aborts incomplete multipart uploads, so a failed shard's unfinished parts do not stay in their bucket.
The README lists the exact requirements to send them.
4. Start, after the go-ahead
python manage.py export_recordings_to_s3 --quote-id <quote id> --role-arn <role ARN> --bucket <bucket> \
--region <bucket region> --prefix <prefix> --approved-by <admin email> [--kms-key-id <key id or ARN>]--approved-by is the organization admin who sent the role ARN. The command refuses anyone who is not an admin of the team's organization, and a role another organization registered.
The start writes a Replay entry to the organization's activity log with the role, bucket and approver, so the customer can see where their recordings went.
Without --yes, the command prints the quote and the destination and stops, because an exec has no terminal to answer its prompt.
Show that output to the person.
Rerun with --yes only after they confirm that exact quote and destination.
Keep the printed workflow ID.
5. Monitor
python manage.py export_recordings_to_s3 --status <workflow id>A large export runs for hours or days.
When a run is far slower than the quote's estimate, check worker CPU as the README's Throughput section describes before you suggest more shards.
A run checks the role and a test upload (one small part, then aborted, so nothing is left) before its first shard.
A failure there names the missing permission in --status. Once the customer fixes the role, start the same quote again while it is valid.
A credentials failure during a shard is permanent in the same way.
Other shard failures retry on their own and resume from their last checkpoint.
A shard that still fails after its retries does not stop the run. The run writes its summary and then ends as failed, with the failed shards in the error and in summary.json under failed_shards.
Ask the person before you rerun them. Then start the same quote again with --shards <the failed list>.
The command refuses --shards unless the quote's last run failed, so a first start always covers the whole selection.
A quote can start again only after a failed run, so a second start of a running or finished export is refused.
6. Hand over
When the status is completed, summary.json is in the bucket under {prefix}/{team_id}/{run_id}/manifests/.
Each run, including a rerun of failed shards, has its own run_id folder.
Report its session totals: exported, deleted, expired, missing, and deleted_before_run.
Explain any non-zero count other than exported.
Tell the customer they can check each file against the sha256 in the manifests, and play a file back in Replay's file playback page.
Done means
- The person has the quote figures, and you started nothing without their go-ahead.
- Or the run completed and you reported the summary totals.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

