AI coding assistants like Cursor, GitHub Copilot, and Claude are incredibleโuntil they're not. One wrong autocomplete can cascade into hours of debugging. Git doesn't help because you haven't committed yet.
SnapBack is your safety net for AI-native development.
| The Problem | The Solution |
|---|---|
| AI makes a bad change | Automatic snapshots before risky edits |
| You don't notice until later | Risk analysis flags dangerous patterns |
| Git history is clean (no commits yet) | One-click recovery with snap undo |
| Same mistake happens again | Learning loop auto-promotes patterns |
| Works in Cursor but not VS Code | Editor-agnostic protection |
- โก <100ms snapshot creation
- ๐ฏ 89% AI change detection accuracy
- ๐ Privacy-first โ code never leaves your machine
- ๐ง Self-improving โ learns from your mistakes automatically
SnapBack has two primary interfaces:
The extension provides the best experience with automatic snapshots, visual recovery UI, and real-time risk indicators.
ext install MarcelleLabs.snapback-vscode
Or search "SnapBack" in the VS Code Extensions marketplace.
For terminal workflows, CI/CD integration, and MCP server setup:
# Install globally
npm install -g @snapback/cli
# Or run without installing
npx @snapback/cli <command># Interactive setup wizard (recommended for first-time users)
snap wizard
# Or quick init
snap init
# Analyze a file for risk
snap analyze src/auth.ts
# Create a snapshot before risky changes
snap snapshot -m "Before auth refactor"
# Pre-commit validation
snap check --all
# Something went wrong? Recover instantly
snap undoSnapBack includes an MCP (Model Context Protocol) server that lets AI assistants understand your codebase and create checkpoints.
The CLI can automatically configure MCP for all detected AI tools:
# Auto-detect and configure all AI tools
snap tools configure
# Or configure specific tools
snap tools configure --cursor
snap tools configure --claude
snap tools configure --windsurfIf you prefer manual configuration or the auto-setup doesn't work, add this to your AI tool's MCP config:
{
"mcpServers": {
"snapback": {
"command": "npx",
"args": [
"-y",
"@snapback/cli",
"mcp",
"--stdio",
"--workspace",
"/absolute/path/to/your/project"
],
"env": {
"SNAPBACK_API_KEY": "your-api-key-here"
}
}
}
}{
"mcpServers": {
"snapback": {
"command": "snap",
"args": [
"mcp",
"--stdio",
"--workspace",
"/absolute/path/to/your/project"
],
"env": {
"SNAPBACK_API_KEY": "your-api-key-here"
}
}
}
}{
"mcpServers": {
"snapback": {
"command": "node",
"args": [
"/absolute/path/to/node_modules/@snapback/cli/dist/index.js",
"mcp",
"--stdio",
"--workspace",
"/absolute/path/to/your/project"
],
"env": {
"SNAPBACK_API_KEY": "your-api-key-here"
}
}
}
}| Tool | Config Path |
|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) |
| Cursor | ~/.cursor/mcp.json |
| Windsurf | ~/.windsurf/mcp.json |
| Continue | ~/.continue/config.json |
The MCP server requires at least one of these markers in your project:
.git/directorypackage.jsonfile.snapback/directory
# Check which tools are configured
snap tools status
# Validate configurations
snap tools validate
# Repair broken configs
snap tools repairOnce configured, your AI assistant can use:
| Tool | Description |
|---|---|
snapback.get_context |
Understand your codebase |
snapback.analyze_risk |
Assess change risks |
snapback.create_checkpoint |
Create safety snapshots (Pro) |
snapback.restore_checkpoint |
Recover from mistakes (Pro) |
| Feature | Git Stash | SnapBack |
|---|---|---|
| Automatic snapshots | โ Manual | โ On save |
| AI change detection | โ | โ Cursor, Copilot, Claude |
| Risk analysis | โ | โ Per-file scoring |
| Recovery UX | ๐ฌ Arcane | โ
snap undo |
| Feature | Cursor | SnapBack |
|---|---|---|
| Works in any editor | โ | โ |
| Risk scoring | โ | โ |
| Learning from mistakes | โ | โ |
| CLI access | โ | โ |
| MCP integration | โ | โ |
| Feature | Static Analysis | SnapBack |
|---|---|---|
| Local-first | โ Cloud | โ |
| AI source detection | โ | โ |
| Recovery/snapshots | โ | โ |
| Personal learning | โ | โ |
| Command | Description |
|---|---|
snap init |
Initialize .snapback/ in your workspace |
snap snapshot |
Create a snapshot of current state |
snap analyze <file> |
Risk analysis for a file |
snap check |
Pre-commit validation |
snap list |
List all snapshots |
snap undo |
Revert the last destructive operation |
snap status |
Show workspace status |
snap fix |
Fix common issues |
| Command | Description |
|---|---|
snap login |
OAuth login flow |
snap logout |
Clear credentials |
snap whoami |
Show current user |
| Command | Description |
|---|---|
snap context [task] |
Get relevant patterns before starting work |
snap validate <file> |
Run 7-layer validation pipeline |
snap validate --all |
Validate all staged files |
snap stats |
Show learning statistics |
| Command | Description |
|---|---|
snap learn record |
Record a new learning |
snap learn list |
List recorded learnings |
snap patterns report |
Report a violation (auto-promotes at 3ร) |
snap patterns summary |
Show violation patterns |
| Command | Description |
|---|---|
snap protect add <file> |
Add file to protection list |
snap protect remove <file> |
Remove from protection |
snap protect list |
List protected files |
snap session start |
Start a coding session |
snap session end |
End current session |
snap watch |
Continuous file watching |
| Command | Description |
|---|---|
snap mcp --stdio |
Start MCP server for AI assistant integration |
snap tools configure |
Auto-setup MCP for detected AI tools |
snap tools configure --cursor |
Configure for Cursor only |
snap tools configure --claude |
Configure for Claude Desktop only |
snap tools configure --windsurf |
Configure for Windsurf only |
snap tools configure --npm |
Use npx mode (recommended for npm users) |
snap tools configure --dev |
Use local development mode |
snap tools status |
Check MCP configuration status |
snap tools validate |
Validate MCP configurations |
snap tools repair |
Repair broken MCP configurations |
| Command | Description |
|---|---|
snap daemon start |
Start SnapBack daemon |
snap daemon stop |
Stop SnapBack daemon |
snap daemon status |
Check daemon status |
snap daemon restart |
Restart daemon |
| Command | Description |
|---|---|
snap wizard |
Interactive first-run setup |
snap doctor |
Diagnostics and health check |
snap doctor --fix |
Auto-fix detected issues |
snap upgrade |
Check for CLI updates |
snap config list |
List configuration values |
snap config get <key> |
Get a specific config value |
snap config set <key> <value> |
Set a configuration value |
snap alias list |
List command shortcuts |
snap alias set <name> <cmd> |
Create a command alias |
snap interactive |
Guided TUI workflow |
When you run snap validate or snap check, SnapBack analyzes your code across seven layers:
| Layer | What It Checks |
|---|---|
| Syntax | Bracket matching, semicolons |
| Types | any usage, @ts-ignore, non-null assertions |
| Tests | Vague assertions, 4-path coverage |
| Architecture | Layer boundaries, service bypass |
| Security | Hardcoded secrets, eval() |
| Dependencies | Deprecated packages |
| Performance | console.log, sync I/O, await in loops |
# Validate a single file
snap validate src/auth.ts
# Validate all staged files (quiet mode for CI)
snap validate --all --quiet
# JSON output for automation
snap validate --all --jsonSnapBack tracks violations and automatically promotes patterns:
| Occurrence | Action |
|---|---|
| 1ร | Stored in violations.jsonl |
| 3ร | Auto-promoted to workspace-patterns.json |
| 5ร | Marked for automated detection |
# Report a violation manually
snap patterns report
# View promotion status
snap patterns summarySnapBack implements best practices from GitHub CLI, Vercel CLI, and Stripe CLI.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ [ERR_NOT_INIT] Workspace Not Initialized โ
โ โ
โ This workspace hasn't been set up for SnapBack โ
โ โ
โ ๐ก Suggestion: โ
โ Initialize SnapBack in this directory โ
โ โ
โ ๐ Try running: โ
โ $ snap init โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
$ snap statis
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Unknown command: statis โ
โ โ
โ Did you mean: โ
โ $ snap status โ
โ $ snap stats โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
# Create shortcuts
snap alias set st status
snap alias set ss snapshot
# Use them
snap st
snap ss -m "checkpoint"snap init --dry-run
# Shows what will be created without making changes
snap tools configure --dry-run
# Shows what MCP config would be written# Bash
eval "$(snap completion bash)"
# Zsh
eval "$(snap completion zsh)"
# Fish
snap completion fish | sourceCompletion scripts are also available at:
resources/completions/snap.bashresources/completions/snap.zshresources/completions/snap.fish
#!/bin/sh
# .git/hooks/pre-commit
npx @snapback/cli check --snapshot --quiet# .lefthook.yml
pre-commit:
commands:
snapback:
run: npx @snapback/cli check --all --quiet- name: Validate code
run: npx @snapback/cli validate --all --json > validation.json
- name: Check for risky changes
run: npx @snapback/cli check --quietAfter snap init:
your-project/
โโโ .snapback/
โ โโโ config.json # Workspace config
โ โโโ vitals.json # Health metrics
โ โโโ constraints.md # Your rules (optional)
โ โโโ patterns/
โ โ โโโ violations.jsonl # Tracked violations
โ โ โโโ workspace-patterns.json
โ โโโ learnings/
โ โโโ user-learnings.jsonl
โโโ .snapbackrc # CLI config
{
"protectionLevel": "warn",
"autoSnapshot": true,
"riskThreshold": 5.0,
"ignorePaths": ["node_modules", "dist", ".git"]
}$ snap doctor
๐ฅ SnapBack Diagnostics
โ Node.js version v20.10.0
โ CLI installation v1.0.11 (latest)
โ Global directory ~/.snapback/ exists
โ Authentication Logged in as @user
โ Workspace .snapback/ initialized
โ MCP tools 3 tools configured
โ Git repository Clean
โ Network API reachable
All checks passed!| Code | Meaning |
|---|---|
0 |
Success |
1 |
Issues found (validation failed, risky changes) |
| Package | Description |
|---|---|
| @snapback-oss/sdk | Production-ready SDK for code safety systems |
| @snapback-oss/contracts | Type definitions and schemas |
| @snapback-oss/infrastructure | Storage and logging utilities |
| @snapback-oss/events | Event definitions and handlers |
| Package | Description |
|---|---|
| MarcelleLabs.snapback-vscode | VS Code extension with visual UI |
Unlock Pro features like checkpoint creation and restoration:
๐ console.snapback.dev/settings/api-keys
Stop losing work to AI mistakes.
Website ยท
Docs ยท
Dashboard ยท
Discord
