Workflows

AI agents

Give each coding agent a writable database branch with its own URL and credentials.

Hand a branch URL to Claude Code, Codex, OpenCode, or your own agent to test migrations, backfills, and queries. Branch writes do not replicate back to the source. The URL grants access to copied data, so keep it private, apply masking when needed, and enforce the network and transport boundaries.

Script-driven

DATABASE_URL="$(snapshotdb create agent-task --from prod --print-url)"
[ -n "$DATABASE_URL" ] || { echo 'branch failed' >&2; exit 1; }
export DATABASE_URL
# ... run the agent against $DATABASE_URL ...
snapshotdb rm agent-task

Agent-driven with a skill

The repo ships a skill describing branch creation, connection rules, and cleanup. For Claude Code, install it in your project:

mkdir -p .claude/skills/snapshotdb
curl -fsSL https://raw.githubusercontent.com/snapshotdb/snapshotdb/main/skills/snapshotdb/SKILL.md \
  -o .claude/skills/snapshotdb/SKILL.md

The skill’s rules: never connect to production; create a branch and use its URL; if --print-url is empty, stop; delete the branch when done. Use an explicit branch name when retrieving a URL in a workspace shared by multiple agents. These instructions complement the server’s access controls; they do not replace them.

Prepared pools for fast claims

Prepare an immutable snapshot and running branches before an agent burst. Recorded prepared claims completed in under a second; preparation, initial replication, and cold resume are separate. This is a measured result, not a latency guarantee. See the benchmark conditions and raw evidence.

snapshotdb prepare agent-pool --from prod --count 3
snapshotdb create agent-task --from agent-pool --print-url

Claims consume finite warm capacity. Repeat prepare to refill the same snapshot; use a new snapshot name for newer source data. An exhausted pool returns an error instead of falling back to a cold clone.