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

# Save state (detailed)

> Reference for the `Save state (detailed)` schema.

## Referenced In

* [saveState](/reference/schemas/savestate)

## Fields

Validation applies the defaults shown here.

| Field     | Type    | Description                                                                                                                                                                      | Default |
| :-------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ |
| path      | string  | Required. Path of the state file, ending in `.json`. A relative path resolves against `directory`, or against `outputDir` when `directory` is omitted. Pattern: `^.*\S.*\.json$` | —       |
| directory | string  | Optional. Directory to save the state file in. A relative directory resolves against the spec file. Omit it to save under `outputDir`. Minimum length: 1. Pattern: `\S`          | —       |
| overwrite | boolean | Optional. Whether to replace an existing state file.                                                                                                                             | `false` |

## Examples

```json
{
  "path": "auth.json"
}
```

```json
{
  "path": "auth.json",
  "directory": "../.auth",
  "overwrite": true
}
```