Claude
Skills
Sign in
Back

snapshot-management

Included with Lifetime
$97 forever

Ralph-town snapshot commands. Use for preflight checks and snapshot creation before reliable sandbox runs.

General

What this skill does


# Snapshot Management

## Quick Reference

**Verify snapshot ready:** `ralph-town sandbox preflight` **Create
snapshot:** `ralph-town sandbox snapshot create`

## sandbox preflight

Verify a snapshot has the tools needed for evals and sandbox command
runs.

```bash
# Check default snapshot (ralph-town-dev)
ralph-town sandbox preflight

# Check specific snapshot
ralph-town sandbox preflight --snapshot my-snapshot

# JSON output for scripts
ralph-town sandbox preflight --json
```

**Flags:**

- `--snapshot <name>` - Snapshot to test (default: ralph-town-dev)
- `--json` - Output as JSON

**What it checks:**

- `/usr/bin/gh` - GitHub CLI
- `/usr/bin/git` - Git
- `/usr/local/bin/pnpm` - pnpm package manager
- `/usr/bin/curl` - curl

## sandbox snapshot create

Create a pre-baked snapshot with all required tools.

```bash
# Create default snapshot
ralph-town sandbox snapshot create

# Create with custom name
ralph-town sandbox snapshot create --name my-snapshot

# Force recreate existing
ralph-town sandbox snapshot create --force

# JSON output
ralph-town sandbox snapshot create --json
```

**Flags:**

- `--name <name>` - Snapshot name (default: ralph-town-dev)
- `--force` - Delete existing snapshot and recreate
- `--json` - Output as JSON

**What snapshot includes:**

- Base image: `node:22-bookworm-slim`
- Tools: git, curl, gh CLI, pnpm
- SDK: @anthropic-ai/claude-agent-sdk
- Working dir: /home/daytona

**Build time:** ~2-3 minutes

## When to Use

- Run `preflight` before relying on a snapshot in evals or kept
  sessions.
- Run `snapshot create` if preflight fails.
- Use `--force` to rebuild after tool updates.

## SDK Usage

```typescript
import { Daytona, Image } from '@daytonaio/sdk';

const daytona = new Daytona();

const image = Image.base('node:22-bookworm-slim')
	.runCommands(
		'apt-get update && apt-get install -y curl git',
		'corepack enable && corepack prepare pnpm@latest --activate',
	)
	.workdir('/home/daytona');

await daytona.snapshot.create(
	{ name: 'my-snapshot', image },
	{ onLogs: console.log, timeout: 300 },
);
```

## Known Limitation

`executeCommand()` returns exit code `-1` on snapshot sandboxes. Use
SSH-backed `ralph-town run` or manual SSH instead. See
[daytonaio/daytona#2283](https://github.com/daytonaio/daytona/issues/2283)

Related in General