> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://platform.bctrl.ai/_mcp/server.

# Run Files

> List and export the files a run produced.

A [run](/sdk/runs) collects the files produced during a session - downloads, screenshots, agent outputs. List them, or export them as a single archive.

## List run files

```ts
const files = await bctrl.runs.files.list(runId);

for await (const file of bctrl.runs.files.iter(runId)) {
  console.log(file.name, file.sizeBytes, file.contentType);
}
```

Filter by `type` to narrow the set.

## Export an archive

```ts
const archive = await bctrl.runs.files.export(runId, {
  // optional: name, type filters
});

console.log(archive.id, archive.path);
```

Export is idempotent - pass an idempotency key so retries do not create duplicate archives. See [Idempotency](/sdk/essentials).

## Moving files in and out of a runtime

To stage durable files into a live runtime or collect runtime files back to storage, use the [runtime files](/sdk/runtimes) namespace (`bctrl.runtimes.files.stage` / `.collect`).

## Next

* [Runtimes](/sdk/runtimes) - stage and collect runtime files
* [Recording](/sdk/recording) - replay the session
* [Idempotency](/sdk/essentials) - safe retries on export