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

# sandbox checkpoint

> Create a restore-point checkpoint of an app's remote sandbox

Save a restore point for an app's [sandbox](https://docs.base44.com/developers/app-code/sandbox/overview.md). A checkpoint appears in the app's version history in the Base44 app editor, where you can restore the app to that state later. Use it to mark a known-good state before or after a set of risky changes.

A checkpoint records the latest commit stored for the app. Before creating it, the command finishes any commit that [`sandbox write`](https://docs.base44.com/developers/references/cli/commands/sandbox-write), [`sandbox edit`](https://docs.base44.com/developers/references/cli/commands/sandbox-edit), or [`sandbox run`](https://docs.base44.com/developers/references/cli/commands/sandbox-run) has started. A file you change in the sandbox another way, such as in a code editor connected to the sandbox, isn't included until it's committed. To include it, run any `sandbox run` command, then create the checkpoint. If the command can't confirm that those commits finished, it fails with `COMMIT_FLUSH_PENDING` instead of checkpointing a stale state. Wait a moment and run it again.

`sandbox` commands don't require a local project. Target an app by passing [`--app-id`](https://docs.base44.com/developers/references/cli/commands/introduction#select-a-target-app), setting the `BASE44_APP_ID` environment variable, or running the command from a linked project if you have one.

> [!NOTE]
>
> This command needs the `sandbox:write` permission. The CLI requests it when you sign in, and an existing session cannot gain it afterwards. If the command fails with an authorization error, run [`base44 login`](https://docs.base44.com/developers/references/cli/commands/login) again to start a session that has it.

## Usage

```bash theme={null}
base44 sandbox checkpoint
```

## Flags

| Flag | Description |
| - | - |
| `--app-id <id>` | Target the specified app. Defaults to the app linked in the current project. See [Select a target app](https://docs.base44.com/developers/references/cli/commands/introduction.md#select-a-target-app). |
| `--branch <name>` | [Target a branch](https://docs.base44.com/developers/references/cli/commands/introduction.md#target-a-branch) of the app by exact name. Defaults to `main`. |
| `--name <name>` | Title for the checkpoint, up to 200 characters. Defaults to a generated title. |
| `--json` | Keep stdout to just the JSON result, without the interactive status line. See [JSON output](https://docs.base44.com/developers/references/cli/commands/introduction.md#json-output). |

## Output

The command returns JSON:

```json theme={null}
{
  "checkpointId": "68a1f0c4e2b91a0012d4c7fa",
  "name": "before refactor",
  "gitCommitHash": "3f9c1ab7d2e845c0b6f31e29a7d4c8b501ae6f32"
}
```

| Field | Description |
| - | - |
| `checkpointId` | ID of the new checkpoint. |
| `name` | The checkpoint title. `null` when no title could be set. |
| `gitCommitHash` | Commit the checkpoint is anchored to. `null` when it is not available. |

## See also

* [Cloud sandbox](https://docs.base44.com/developers/app-code/sandbox/overview.md): How the sandbox works, and what you can change in it
* [`sandbox edit`](https://docs.base44.com/developers/references/cli/commands/sandbox-edit): Apply exact string replacements to a file
* [`sandbox write`](https://docs.base44.com/developers/references/cli/commands/sandbox-write): Create a new file in the sandbox
* [`sandbox run`](https://docs.base44.com/developers/references/cli/commands/sandbox-run): Run a shell command in the sandbox


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