SnapBack

How SnapBack Works

Your AI assistant’s intelligent safety layer.

SnapBack automatically detects when AI tools modify your code, captures full context with every change, and lets you navigate your development timeline with complete understanding.

Git tracks what changed. SnapBack understands who changed it (AI vs human) and why.

The AutoDecisionEngine

At the heart of SnapBack is the AutoDecisionEngine—a decision system that evaluates every file save and determines:

  1. Should we snapshot? (based on risk signals)
  2. How urgent is it? (confidence scoring)
  3. What triggered it? (attribution for learning)

🔍 Signal Aggregation

Combines multiple detection signals:

  • AI detection (Cursor, Copilot, Claude, Windsurf)
  • Risk scoring (file criticality, change scope)
  • Burst detection (rapid multi-file changes)
  • Historical patterns (files that broke before)

🧠 Decision Logic

Makes smart protection decisions:

  • AI tool made substantial changes → Snapshot
  • Critical files modified → Snapshot
  • High-risk change patterns → Snapshot
  • Multiple files changed rapidly → Snapshot

How It Works: Step-by-Step

1. You Save a File

When you save a file, SnapBack’s AutoDecisionEngine springs into action:

graph LR
    A[File Save] --> B[Signal Detection]
    B --> C[AI Detected?]
    B --> D[Risk Scoring]
    B --> E[Burst Detection]
    C --> F[Decision Engine]
    D --> F
    E --> F
    F --> G{Create Snapshot?}
    G -->|Yes| H[Snapshot Created]
    G -->|No| I[Continue]

2. Signal Aggregation

The engine evaluates multiple signals simultaneously:

🤖 AI Activity Signal

Monitors which AI tool is active and how much of your recent work came from AI suggestions

  • • Detects Cursor, Copilot, Claude Code, Windsurf
  • • Tracks AI contribution percentage
  • • ~89% accuracy on common tools
⚠️ Change Risk Signal

Evaluates the scope and nature of your changes

  • • Time since last commit
  • • Number of lines and files modified
  • • Which files changed (critical vs. non-critical)
  • • Rate of change velocity
💥 Burst Detection

Identifies rapid multi-file changes typical of AI refactoring sessions

3. Decision Making

The AutoDecisionEngine combines these signals to decide when to protect you.

Automatic snapshot triggers:

  • AI tool made substantial changes to your code
  • Critical files modified (auth, database, configuration)
  • Multiple files changed rapidly (typical of AI refactoring)
  • Significant time passed since last save point
  • High-risk change patterns detected

Adaptive Learning: The system learns from your patterns. If you frequently navigate back from certain types of changes, SnapBack becomes more protective in those areas.

4. Snapshot Creation

When triggered, SnapBack:

  1. Captures file state (sub-100ms)
  2. Records context (AI tool, session, risk factors)
  3. Updates timeline for navigation
  4. Learns from the pattern

✅ Privacy First: Snapshots are stored locally by default. Your code never leaves your machine unless you explicitly opt-in to cloud features.

What Gets Protected

By default, SnapBack protects files that matter:

✅ Protected by Default

  • • All source code (.js, .ts, .py, .go, etc.)
  • • Configuration files (.json, .yaml, .toml)
  • • Environment files (.env*)
  • • Documentation (.md, .mdx, .rst)
  • • Build configs (package.json, tsconfig.json)

❌ Not Protected

  • .git/ directory
  • node_modules/ and dependency folders
  • • Build outputs (dist/, .next/, etc.)
  • • Binary files
  • • Log files (*.log)

Customizing Protection

While AutoDecisionEngine handles most cases, you can customize with .snapbackrc:

// .snapbackrc
{
  "include": ["src/**/*", "config/**/*"],
  "exclude": ["*.test.ts", "*.spec.ts"],
  "alwaysProtect": ["src/auth/**/*", ".env*"],
  "neverProtect": ["*.generated.ts"]
}

💡 Recommended: Let AutoDecisionEngine learn your patterns for 30 days before adding custom rules. It’s usually smarter than manual configuration.

Viewing Protection Status

In VS Code

The status bar shows current protection state:

IconStateMeaning
🟢ProtectedAutoDecisionEngine active
🟡MonitoringWatching for AI activity
🔴PausedProtection temporarily disabled

In the Dashboard

View protection metrics at console.snapback.dev:

  • Total protection states created
  • AI detections by tool
  • Files protected
  • Navigation history

The Learning Loop

SnapBack gets smarter the longer you use it:

1

🌱 Day 1: Common Patterns

Out of the box, catches:

  • • Hardcoded secrets in code
  • • Phantom dependencies
  • • Test code in production
  • • Risky refactoring patterns
30

🌳 Day 30: Your Patterns

Learns YOUR codebase:

  • • “Cursor always breaks this auth module”
  • • “This refactor pattern causes cascading failures”
  • • “This folder has phantom dependency issues”
90

🌲 Month 3: Proactive Protection

Catches issues before you notice:

  • • Folder-specific risks (historically fragile areas)
  • • Pattern-specific risks (which refactors break things)
  • • Tool-specific risks (which AI tool struggles where)

How Learning Works

SnapBack learns from your development patterns:

  1. File fragility - Tracks which files are historically problematic
  2. AI tool behavior - Learns which AI tools cause issues with specific files
  3. Pattern recognition - Identifies code patterns that correlate with issues

🔒 Privacy First: Learning happens locally by default.
Users can opt-in to share anonymized patterns to help improve detection for everyone. See exactly what’s shared →

Manual Protection Levels (Optional)

Most users don’t need this. The AutoDecisionEngine handles protection automatically. Manual levels are for teams who want explicit control over specific files.

For granular control, you can set manual protection levels:

  • 🟢 Watch — Silent auto-snapshots (zero friction)
  • 🟡 Warn — Confirmation before save (pause to think)
  • 🔴 Block — Required note (audit trail for compliance)

When to use manual levels:

  • Team policies requiring audit trails on specific files
  • Compliance requirements (SOC2, HIPAA)
  • Files that should ALWAYS prompt regardless of AI detection

Manual levels work alongside AutoDecisionEngine—they don’t replace it.

Next Steps

🛡️ Protection States

Experience the intelligence layer with a hands-on walkthrough.

Try it →

🤖 AI Detection

How SnapBack detects and attributes AI-generated changes.

Learn more →

📈 Pattern Learning

How SnapBack learns your codebase patterns over time.

Explore →

Privacy First: SnapBack works 100% offline on the Free plan. MCP is optional and requires explicit consent on paid plans. Learn more →