---
title: "Delete Snapshot"
description: "Documentation for Delete Snapshot Command in ZeyOS SDK CLI"
canonical_url: "https://www.zeyos.com/sdk/snapshot-management/zeysdk-snapshot-delete"
markdown_url: "https://www.zeyos.com/ai/guide/sdk/snapshot-management/zeysdk-snapshot-delete.md"
section: "sdk"
authority: "guide"
language: "en"
source_repository: "zeyos/sdk-v2"
source_path: "docs/snapshot-management/zeysdk-snapshot-delete.md"
source_revision: "a99897af74253b4dc5af6fecb9301cea0ae18e27"
---

# Delete Snapshot

The `snapshot delete` command deletes a specific snapshot.

```bash
zeysdk snapshot delete <SNAPSHOT_ID>
```

**Parameters**

| Parameter | Description | Required | Example |
|-----------|-------------|----------|---------|
| `SNAPSHOT_ID` | ID of snapshot to remove | Yes | `20231101-123456` |

**Process**

1. **Snapshot Lookup**
   - Accepts IDs with or without the `.zip` suffix
   - Accepts only a safe snapshot filename and rejects directory separators or traversal
   - Verifies the resolved archive remains within `.zeysdk/snapshots`
   - Stops when the snapshot does not exist

2. **Deletion**
   - Removes the snapshot archive
   - Removes the snapshot metadata entry
   - Reports successful removal

**Examples**

```bash
zeysdk snapshot delete 20231101-123456
```

**Error Handling**

| Error | Description | Resolution |
|-------|-------------|------------|
| Invalid ID | ID is empty, contains unsafe characters, or contains a path | Copy the ID from `snapshot list` |
| Not found | Snapshot archive does not exist | Check snapshot list |
| Access denied | Permission issue | Check file permissions |

**Notes**

- Delete removes the snapshot archive from local storage
- Delete also removes the matching metadata entry
- The archive is first renamed to a same-directory tombstone; if the atomic metadata update fails, the original archive name is restored
- Invalid or unreadable snapshot metadata stops deletion before the archive is moved
- Delete does not prompt for confirmation when called directly
- Snapshot deletion cannot be undone
- Use `zeysdk snapshot list` to find the exact snapshot ID

**Best Practices**

- Keep snapshots that mark stable milestones
- Remove old snapshots after they are no longer needed
- Verify a newer snapshot exists before deleting an older known-good one
- Avoid deleting snapshots during active rollback work
