Snapback is a VS Code extension designed to help developers seamlessly regain context after periods of inactivity. Ever step away from your code for a break, only to return and struggle to remember exactly what you were doing? Snapback intelligently tracks your activity and, upon your return, provides a concise, AI-powered summary of your last coding session, helping you snap back into focus instantly.
✨ Features
Intelligent Activity Tracking: Monitors your coding activity, including:
Text edits and deletions.
Tab and file switching.
New file creation.
Cursor movements (to detect activity).
Idle Detection: Automatically detects when you've been inactive for a configurable period.
AI-Powered Context Summary: When you return from an idle period, Snapback leverages the Google Gemini API to generate a brief, cohesive paragraph summarizing your recent work. This appears as a subtle notification.
Quick Context Access: Click on the notification to view the AI-generated summary instantly.
Detailed Context View: For deeper insights, a status bar item provides access to a comprehensive log of your captured context, including active file details, open tabs, and recent changes.
🚀 Installation
From VS Code Marketplace (Coming Soon!)
Once published, you'll be able to find and install Snapback directly from the VS Code Marketplace:
Open VS Code.
Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
Search for Snapback.
Click Install.
Manual Installation (for development/testing)
If you're testing the extension locally:
Clone this repository:
git clone [https://github.com/your-username/snapback.git](https://github.com/your-username/snapback.git)
cd snapback
Install dependencies:
npm install
Open the project in VS Code.
Press F5 to open a new Extension Development Host window. Your extension will be active there.
⚙️ Configuration
Snapback requires a Google Gemini API Key to generate AI-powered summaries.
Obtain a Gemini API Key:
Go to Google AI Studio and follow the instructions to get an API key.
Set the API Key in VS Code:
Open VS Code Settings (Ctrl+, on Windows/Linux or Cmd, on macOS).
Search for "Snapback" or "Gemini Api Key".
Locate the setting "Snapback: Gemini Api Key".
Paste your obtained API key into the input field.
Your changes will be saved automatically.
💡 Usage
Snapback works primarily in the background:
Automatic Tracking: Once activated (e.g., when you open a workspace), Snapback automatically begins tracking your coding activity.
Idle Detection & Notification: If you stop interacting with VS Code for a short period (default is 12 seconds, configurable in code), Snapback captures your current context. When you resume activity, a notification will appear in the bottom-right corner of your VS Code window:
💭 Welcome back! Here's what you were working on: [View Summary] [Dismiss]
View Summary: Click the "View Summary" button on this notification, and a new information message will pop up with a concise, AI-generated paragraph summarizing your recent work.
Detailed Context: A status bar item $(history) Context Available will also appear at the bottom-right. Clicking this will open an output channel with a detailed snapshot of your last captured context.