> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stacknext.space/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> StackNext documentation is written for developers using StackNext in a Next.js App Router project. Use the getting-started and guides sections to install and operate the product, and the reference section for CLI, configuration, MCP and package surfaces. Version-matched package API reference ships inside each npm package under node_modules/@stacknext/<package>/docs/ and is preferred over this site for installed-version APIs. Diagnostic findings are evidence, not confirmed root causes; regression comparisons are deterministic and report-only. Contributor and repository-maintenance documentation is not part of this site.

# Snapshots

> Save, inspect, export and import frozen redacted samples without replaying them into the live store.

A snapshot is a versioned, redacted copy of one sample saved under
`.stacknext/snapshots`. It is evidence from the save time, not live telemetry.
Snapshots are never replayed into the collector and snapshot reads carry no live
diagnostics or coverage.

## Create

```bash theme={null}
pnpm exec stacknext snapshot save --label "before change"
```

`stacknext dev` can also save automatically on graceful exit and on the first
error, with a 60-second cooldown. Automatic behavior is configured under
`snapshots` in `stacknext.config.json`:

```json theme={null}
{
  "snapshots": {
    "autoOnExit": true,
    "autoOnError": true,
    "autoKeep": 10,
    "maxBytes": 67108864
  }
}
```

> [!NOTE]
>
> Manual and imported snapshots are never auto-deleted. Automatic exit/error
> snapshots rotate beyond `autoKeep`. Oversized saves fail instead of truncating.

## Inspect

```bash theme={null}
pnpm exec stacknext snapshot list
pnpm exec stacknext snapshot show <snapshot-id>
```

The dashboard `/snapshots` page shows the sample window, counts, traces, errors
and queries. If the snapshot was saved before a change, say so when reporting
evidence.

![Snapshots view listing saved samples with source, capture window, request, span, error and query counts](https://mintcdn.com/stack-next/wvbZ0Zo0GO0UM1X7/screenshots/snapshots.png?fit=max\&auto=format\&n=wvbZ0Zo0GO0UM1X7\&q=85\&s=83cab35ac56a699ef3f711cc2810bda7)

![Snapshots view listing saved samples with source, capture window, request, span, error and query counts](https://mintcdn.com/stack-next/wvbZ0Zo0GO0UM1X7/screenshots/snapshots-dark.png?fit=max\&auto=format\&n=wvbZ0Zo0GO0UM1X7\&q=85\&s=6769419438e60bb5ff368c42ce036580)

## Export and import

```bash theme={null}
pnpm exec stacknext snapshot export <snapshot-id> -o sample.json
pnpm exec stacknext snapshot import sample.json --label "reported issue"
```

Exports are redacted local JSON with `0600` permissions. Imports are
re-normalized and re-redacted, so a modified file cannot introduce unredacted
fields. Import is not a live replay.

## Delete

```bash theme={null}
pnpm exec stacknext snapshot delete <snapshot-id> --yes
```

Deletion is explicit. The CLI does not delete manual or imported snapshots
automatically.

## MCP boundary

The three snapshot MCP tools are read-only:

* `stacknext_list_snapshots`
* `stacknext_get_snapshot`
* `stacknext_get_snapshot_trace`

They cannot save, import, rotate or delete a snapshot. An agent should point to
the CLI or dashboard instead.

## Related

* [Privacy](https://docs.stacknext.space/privacy.md)
* [Runtime evidence](https://docs.stacknext.space/guides/runtime-evidence.md)
* [CLI commands](https://docs.stacknext.space/cli/commands.md)
* [MCP tools](https://docs.stacknext.space/reference/mcp-tools.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.