Session Time-Travel
The Challenge: Multi-File AI Changes
Your AI assistant just refactored 5 files. The output looks good, but something broke:
π§’ Files Modified:
β src/auth.ts (looks good)
β src/user.ts (looks good)
β src/index.ts (undefined reference!)
β src/middleware.ts (looks good)
β tests/auth.test.ts (looks good)
Your options:
- Option A: VS Code undo (Cmd+Z) 10+ times individually per file = slow
- Option B: Git revert commit = loses all good work
- Option C: Manual fix = hours of debugging
- Option D: SnapBack sessions = 1 click navigate all 5 files with full context βοΈ
How Sessions Work
SnapBack automatically groups related snapshots based on timing and context:
Automatic Grouping
SnapBack intelligently groups snapshots into sessions based on timing and context.
Atomic Navigation
Navigate entire sessions with one action, ensuring consistency across all modified files.
Time Navigation
Navigate through your coding history with intuitive time-travel controls.
Session Triggers
SnapBack automatically creates new sessions based on these triggers:
Session Grouping Example
Hereβs what SnapBack automatically created:
π¦ Session: "Claude refactored auth system" (14:05 - 14:23 UTC)
βββ Trigger: Multiple file saves within 60s
βββ Files in Session:
β ββ src/auth.ts (3 snapshots: 14:05, 14:12, 14:18)
β ββ src/user.ts (2 snapshots: 14:06, 14:19)
β ββ src/index.ts (2 snapshots: 14:07, 14:23)
β ββ src/middleware.ts (1 snapshot: 14:08)
β ββ tests/auth.test.ts (2 snapshots: 14:09, 14:21)
βββ AI Detection: π΄ HIGH RISK
ββ src/index.ts has undefined reference (detected 14:23)
Click βApply Stateβ β All 5 files navigate to 14:04 state β 2 seconds βοΈ
How Sessions Are Grouped
SnapBack uses this logic:
- Timing: Snapshots within 60 seconds of each other group together
- AI Detection: Same AI assistant detected across files β same session
- User Activity: Idle gap >105s β new session starts
- Git Events: Git commit β new session starts
Time-Based Triggers
- 105s Idle Gap: After 105 seconds of inactivity, a new session begins
- Window Blur: When you switch away from VS Code, the current session ends
Action-Based Triggers
- Git Commit: Each Git commit starts a new session
- Task Completion: Finishing a coding task (configured in settings)
Manual Triggers
You can also manually create sessions:
# Create a new session manually
snapback session create --name "Implement user authentication"
# End current session
snapback session end
Session Structure
Each session contains:
- Metadata: Timestamp, duration, trigger event
- File Changes: All snapshots created during the session
- AI Detection Results: Any risks detected during the session
- User Notes: Optional notes added during the session
Time-Travel Navigation
Navigate through your coding history with intuitive controls:
VS Code Extension
- Open the SnapBack panel (
View β SnapBack) - Switch to the βSessionsβ tab
- Browse through your session history
- Click on any session to view its protection states
- Apply the entire session or individual protection states
CLI Tool
# List all sessions
snapback session list
# View session details
snapback session view --id session_12345
# Navigate to a session state
snapback session restore --id session_12345
# Compare sessions
snapback session diff --id session_12345 --id session_67890
Session vs Snapshot Differences
Understanding the relationship between sessions and snapshots:
| Concept | Description | Scope |
|---|---|---|
| Snapshot | Point-in-time capture of a single file | Single file |
| Session | Group of related snapshots with shared context | Multiple files |
Navigation Process
Applying a session state is simple and safe:
Step 1: Identify the Session
Find the session you want to explore:
Step 2: Review Changes
Before applying, review what will be changed:
Step 3: Apply State
Apply the session state:
# Apply an entire session state
snapback session restore --id session_12345
# Apply specific files from a session
snapback session restore --id session_12345 --files src/index.js,src/utils.js
# Preview changes before applying
snapback session restore --id session_12345 --dry-run
Best Practices
π·οΈ Name Important Sessions
Give meaningful names to important sessions to make them easier to find later.
π Add Context Notes
Add notes to sessions explaining what you were working on and any important context.
β° Be Mindful of Timing
Take breaks to allow natural session boundaries, making it easier to navigate your history.
π Review Before Applying
Always review session changes before applying to avoid unintended modifications.
Advanced Features
Session Comparison
Compare different sessions to understand changes over time:
# Compare two sessions
snapback session diff --id session_12345 --id session_67890
# Export session comparison as HTML report
snapback session diff --id session_12345 --id session_67890 --format html > comparison.html
Session Export
Export sessions for backup or sharing:
# Export a session
snapback session export --id session_12345 --output session_backup.json
# Import a session
snapback session import --input session_backup.json
Related Documentation
- Protection Levels - Granular file-level control
- AI Detection - Real-time risk analysis
- CLI Documentation - Command-line interface for automation
- VS Code Commands - IDE integration for real-time protection
π‘ Pro Tip: Use sessions as a natural checkpoint in your development workflow. Before starting a major refactor or implementing a new feature, take a moment to let the current session end naturally.