Backup & Restore
This guide explains how to back up and restore project governance/runtime state managed by s2s.
What is included
Section titled “What is included”s2s backup stores:
- Full project-local
.s2s/workspace - Root compatibility shims for chat clients:
AGENTS.mdCODEX.mdCLAUDE.md
Global backup location
Section titled “Global backup location”Backups are stored globally (outside app repo) with project isolation:
~/.s2s/backups/projects/<project-hash>/<snapshot-id>/ manifest.json s2s/ root/<project-hash>: deterministic hash from absolute app root path<snapshot-id>: ISO-like timestamp id
Commands
Section titled “Commands”Create backup (current project context):
s2s backupCreate backup for explicit project alias/path:
s2s backup my-projectRestore latest snapshot:
s2s restore --latestRestore specific snapshot:
s2s restore --snapshot=<snapshot-id>Restore specific project:
s2s restore my-project --latestSafety behavior on restore
Section titled “Safety behavior on restore”Before writing restored files, s2s restore always creates an automatic pre-restore safety backup.
This means every restore operation can be rolled back via another restore operation.
How to inspect available snapshots
Section titled “How to inspect available snapshots”Use your shell to list snapshots for a project:
ls ~/.s2s/backups/projectsls ~/.s2s/backups/projects/<project-hash>Tip: s2s backup output prints the snapshot id and project backup directory.
Recommended usage policy
Section titled “Recommended usage policy”- Create a backup before major config edits (
s2s config edit). - Create a backup before stage transitions with risky runtime changes.
- Keep backup/restore operations in your delivery checklist.
- Note that
s2salso creates automatic pre-policy snapshots when guardrail discrepancy decisions are applied in init/config.