checking-member-access
Explains what a member or a role can do in a PostHog project, using the access control MCP tools. Use when the user asks what someone can see or edit, who can…
Export PostHog events, persons, sessions, or the results of a HogQL query on demand and download the resulting files. Use when the user asks to download/export raw PostHog data, export HogQL query results, create a one-off file export, fetch a Parquet or JSONLines export, or use
$ npx -y skills add posthog/posthog --skill downloading-batch-export-files --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/downloading-batch-export-filesContext preview
The summary Claude sees to decide when to auto-load this skill.
Export PostHog events, persons, sessions, or the results of a HogQL query on demand and download the resulting files. Use when the user asks to download/export raw PostHog data, export HogQL query results, create a one-off file export, fetch a Parquet or JSONLines export, or use
name: downloading-batch-export-files description: > Export PostHog events, persons, sessions, or the results of a HogQL query on demand and download the resulting files. Use when the user asks to download/export raw PostHog data, export HogQL query results, create a one-off file export, fetch a Parquet or JSONLines export, or use the file_download_batch_exports API. Covers starting the export with MCP, polling completion, and downloading via the existing REST redirect endpoint.
Use this skill when a user wants a one-off downloadable export of PostHog data. The export is started and monitored through MCP, but the final file download uses the existing REST endpoint directly.
| Tool | Purpose | | ---------------------------------------------- | -------------------------------------------------------- | | `posthog:file-download-batch-exports-create` | Start an on-demand export and return the run ID | | `posthog:file-download-batch-exports-retrieve` | Poll the run status and return file IDs after completion |
Do not rely on a generated MCP tool for the `/download/` endpoint. That endpoint is a redirecting file download endpoint, so raw HTTP/download handling is the right interface until MCP has explicit redirect support.
Ask a short clarifying question if the user did not specify the required inputs:
Required for `events`, `persons`, and `sessions`, and not supported for `hogql`
Lower it when the user wants smaller parts, raise it for fewer and bigger ones, or set it to `null` to write a single file of any size.
For `events`, `include` and `exclude` are optional event-name filters. Use them only when the user asks for specific events or wants to omit specific events.
For `hogql`, pass the query as `hogql_query` and leave out `data_interval_start`, `data_interval_end`, `include`, and `exclude`. The query runs as of the time the export starts, so there is no interval to choose. You may prompt the user to export a slice of data by including a WHERE clause in the HogQL query, for example limiting results from the `events` table by bounding `timestamp`. Always prefer limiting the data exported to the minimum necessary to solve the user's request. Every column in the SELECT clause must be a field or have an alias, and placeholders are not supported. This model is in closed beta and is enabled per team.
Call `posthog:file-download-batch-exports-create` with the selected shape. The response contains an `id` for the export run.
Example request:
{
"model": "events",
"file": {
"format": "JSONLines",
"compression": "gzip"
},
"include": ["$pageview"],
"data_interval_start": "2026-05-25T00:00:00Z",
"data_interval_end": "2026-05-26T00:00:00Z"
}Example request for the `hogql` model:
{
"model": "hogql",
"file": {
"format": "Parquet"
},
"hogql_query": "SELECT event, timestamp, properties.$current_url AS url FROM events WHERE timestamp > now() - INTERVAL 1 HOUR"
}Call `posthog:file-download-batch-exports-retrieve` with the returned `id`.
Status handling:
| Status | Action | | ------------------------------------------------------------------------- | --------------------------------------------- | | `Starting` or `Running` | Wait briefly and poll again | | `Completed` | Read the `files` array and download each file | | `Cancelled` | Stop and report that the run was cancelled | | `Failed`, `FailedRetryable`, `FailedBilling`, `Terminated`, or `TimedOut` | Stop and report the `error` field |
When `Completed`, the `files` array contains file UUIDs. For single-file exports it usually contains one UUID. For split exports, download every UUID unless the user asked for a specific part.
A `Completed` response also carries `records_completed`, the number of rows the run exported. Report it to the user, because the count is otherwise only visible by opening every file.
If required by the user, a running export can be cancelled by calling `posthog:file-download-batch-exports-cancel-create` with the returned `id`.
An export that has already finished or has already failed may not be cancelled.
After cancelling an export, the `id` may not be used anymore and the export must start again from the beginning. However, you may still use the `id` to retrieve the export status (which will always be `Cancelled`).
Use a direct authenticated HTTP request to the existing endpoint:
GET /api/projects/{project_id}/file_download_batch_exports/{run_id}/download/{part}/`part` can be either:
If there is only one file, this also works without `part`:
GET /api/projects/{project_id}/file_download_batch: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
Explains what a member or a role can do in a PostHog project, using the access control MCP tools. Use when the user asks what someone can see or edit, who can…
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…
Author continuously-running online evaluations in PostHog AI observability, grounded in real failure modes you've identified. Use when the user wants…
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…
Investigate AI observability clusters — understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into…
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…