Introducing Grok Snap: Your AI Assistant That Lives Alongside Any Windows Application
Teaching Your AI to Follow You Around Like a Helpful Puppy
Have you ever wished you could have an AI assistant right next to whatever application you’re working in? Not in a separate window that you have to alt-tab to, but literally snapped to the side of your active window, following it wherever it goes? That’s exactly what Grok Snap Chat does, and it’s unlike anything you’ve used before.
What Is Grok Snap Chat?
Grok Snap Chat is a Windows desktop application that creates a persistent AI chat interface powered by xAI’s Grok that can snap to and follow any application window on your screen. Think of it as a smart sidebar that attaches to your browser, code editor, spreadsheet, or any other application—and stays there, moving with the window as you work.
But here’s where it gets really interesting: Grok Snap Chat doesn’t just chat with you. It can actually see what’s in the window it’s attached to and answer questions about it, summarize content, analyze data, or provide insights on whatever you’re viewing.
Why This Matters
As someone who works with multiple applications throughout the day—coding, writing, analyzing data, researching—I found myself constantly switching between my work and a separate AI chat window. It was disruptive and broke my flow. I wanted something that could:
Stay visible while I work without covering my content
Move with my active window so I don’t have to reposition it constantly
See what I’m seeing and provide contextual help
Be lightweight and non-intrusive
That’s the genesis of Grok Snap Chat.
Key Features
🪟 Intelligent Window Snapping
Select any open window from a dropdown menu, choose your preferred edge (right, left, top, or bottom), click “Snap,” and the chat pane automatically attaches. As you move or resize the target window, Grok Snap Chat follows along seamlessly. It’s always there when you need it, never in the way.
🎯 Auto-Window Detection
This is a game-changer for workflow. As you drag the chat pane around your screen, the dropdown automatically updates to show which window you’re hovering over. No more hunting through lists—just position the chat near your target window, and it knows exactly what you mean. When you click “Snap,” it instantly attaches to the detected window.
👁️ Window Content Analysis
This is the killer feature. Click the “Analyze Window Content” button, and Grok Snap Chat captures a screenshot of the window it’s attached to and sends it to Grok’s vision model. Within seconds, you get an AI-powered analysis of what’s visible on screen.
Real-world examples:
Snap to Excel and ask “What trends do you see in this data?”
Snap to your browser and get instant summaries of articles or documentation
Snap to Visual Studio Code and ask “Are there any obvious bugs in this code?”
Snap to a PDF reader and request “Summarize the key points from this section”
💬 Full Conversational Context
Unlike simple screenshot tools, Grok Snap Chat maintains the entire conversation history. After analyzing a window, you can ask follow-up questions, request clarifications, or drill deeper into specific aspects—all with the AI remembering the full context. Plus, you can save conversations and load them later to continue exactly where you left off.
⚙️ Built-in Settings Management
API Key Storage: No more messing with environment variables or PowerShell commands. Enter your xAI API key once in the Settings dialog, and it’s securely saved for all future sessions. The app remembers it automatically.
Snap Position Control: Choose where the chat pane attaches—right edge (default), left edge, top, or bottom. Perfect for different monitor setups or personal preferences. Change it anytime from Settings.
Opacity Control: Adjust window transparency from 30% to 100%. Make the chat translucent to see content behind it, or keep it fully opaque for maximum readability. Real-time slider with instant feedback.
💾 Conversation Management
Save & Load: Export conversations as JSON files with timestamps. Resume previous discussions with full context intact. Perfect for long-term projects or research that spans multiple sessions.
Easy Access: One-click button opens your conversations folder in Windows Explorer. All saved chats are organized in Documents\Grok Snap Chat Conversations\ with timestamped filenames.
🎯 Smart Features for Productivity
Multi-line Input: Type longer, more detailed questions with proper formatting. Press Ctrl+Enter to send.
Clear Chat: Start fresh conversations with one click when switching contexts.
Unsnap Mode: Need to move the chat somewhere else? Unsnap it and drag it anywhere on your screen. The window list automatically refreshes when you unsnap.
Always on Top: The chat pane stays visible even when you’re actively working in other applications.
Modern Dark UI: A sleek, professional interface that won’t strain your eyes during long work sessions.
How It’s Useful
For Developers
Get code reviews on the fly without leaving your IDE
Ask questions about documentation while it’s visible
Debug issues by showing Grok your error messages
Learn new frameworks with contextual help
For Writers and Content Creators
Get instant feedback on drafts
Summarize research articles while reading them
Analyze competitor content side-by-side
Brainstorm ideas while looking at references
For Data Analysts
Quick insights on charts and visualizations
Data quality checks on spreadsheets
Trend identification in dashboards
Formula assistance while building reports
For General Productivity
Summarize long emails or documents
Get quick explanations of complex topics
Compare information across multiple sources
Keep an AI assistant accessible at all times
Technical Requirements
Grok Snap Chat is designed for Windows and requires:
Operating System: Windows 10 or Windows 11
Python: Version 3.9 or higher
xAI API Key: Get yours at x.ai (configured in-app)
Dependencies:
PyQt6 (for the GUI)
requests (for API calls)
Pillow (for screenshot capture)
That’s it. No complex setup, no cloud services beyond xAI’s API, and no heavy system requirements. Settings and conversations are stored locally on your machine.
How to Install and Run
Step 1: Get the Code
The complete source code is available in my GitHub JunkDrawer repository:
GitHub: https://github.com/rod-trent/JunkDrawer/tree/main/Grok%20Snap
Download or clone the repository to your local machine.
Step 2: Install Dependencies
I’ve included a setup.bat file to make this painless. Simply double-click it, or run from PowerShell:
cd "path\to\Grok Snap"
.\setup.batOr install manually:
pip install -r requirements.txtStep 3: Configure Your API Key
Instead of setting environment variables, just:
Run the application:
python grok_snap_chat.pyClick the ⚙️ Settings button (gear icon in the title bar)
Enter your xAI API key in the text field
Click Save Settings
That’s it! Your API key is now securely stored and will load automatically every time you run the app. The key is saved in ~/.grok_snap_chat/settings.json in your user directory.
Note: You can still use the XAI_API_KEY environment variable if you prefer, but the in-app settings method is much easier.
Step 4: Run the Application
python grok_snap_chat.pyThe application window will appear, ready to snap to any window you choose.
How to Use It
Basic Workflow
Launch the application
Configure Settings (first time):
Click the ⚙️ Settings button
Enter your xAI API key
Choose your preferred snap position (Right, Left, Top, or Bottom)
Adjust opacity if desired (30-100%)
Click Save Settings
Position the window near your target application
The dropdown automatically detects what window you’re hovering over
Click “📌 Snap to Window” and the chat pane attaches to your chosen edge
Start chatting with Grok normally, or...
Click “👁️ Analyze Window Content” to have Grok analyze what’s on screen
Ask follow-up questions about the analyzed content
Manage conversations:
Click “🗑️ Clear Chat” to start fresh
Use Settings to save/load conversations
Click “📁 Open Conversations Folder” for easy access to saved chats
Click “🔓 Unsnap” if you need to move the chat pane elsewhere
Pro Tips
Keyboard Shortcuts:
Press Ctrl+Enter to send your message (works in multi-line input)
Press Alt+F4 to close the application
Window Management:
The chat pane automatically resizes to match your target window’s height (for left/right snap)
For top/bottom snap, it uses full window width with fixed 300px height
If the target window closes, you’ll get a notification and can snap to a different window
The 🔄 refresh button lets you update the window list if you open new applications
Auto-detection only works when not snapped—position the window first, then snap
Vision Features:
The app automatically brings your target window to the foreground before analyzing
Takes a brief 200ms pause before capturing to ensure the window is fully rendered
You can analyze the same window multiple times as content changes
Ask specific questions after analysis like “What’s in column B?” or “Explain the error message”
Conversation Management:
Conversations are saved with timestamps in your Documents folder
Save before closing if you want to resume later
Load previous conversations to continue with full context
JSON format allows you to view/edit conversations in any text editor
Settings Persistence:
All settings (API key, snap position, opacity) are saved automatically
Settings persist across sessions—configure once, use forever
Settings stored in:
C:\Users\[YourUsername]\.grok_snap_chat\settings.json
Under the Hood: How It Works
For the technically curious, here’s what makes Grok Snap Chat tick:
Window Snapping Technology
The app uses Windows API calls through Python’s ctypes library to:
Enumerate all visible windows with
EnumWindowsGet real-time window positions with
GetWindowRectMonitor window movements every 100ms
Calculate and update the chat pane position dynamically
The positioning adapts based on your chosen snap mode:
# Right edge (default)
x = target_window.right
y = target_window.top
height = target_window.height
# Left edge
x = target_window.left - chat_width
y = target_window.top
height = target_window.height
# Top edge
x = target_window.left
y = target_window.top - 300
width = target_window.width
# Bottom edge
x = target_window.left
y = target_window.bottom
width = target_window.widthAuto-Window Detection
A separate timer checks twice per second (every 500ms) to detect which window the chat pane is hovering over:
Uses
WindowFromPointto identify the window at specific coordinatesChecks a point just outside the chat window (10px to the left)
Uses
GetAncestorto find the top-level parent windowAutomatically updates the dropdown selection
Only active when not snapped (to avoid interference)
Refreshes window list if new windows are detected
Screenshot Capture
Window content capture uses PIL’s ImageGrab.grab() with a bounding box:
Get the window’s screen coordinates
Bring the window to foreground with
SetForegroundWindowWait 200ms for rendering
Capture that specific region of the screen
Convert to PNG format
Encode as base64 for API transmission
This approach is simple, reliable, and doesn’t require complex Windows GDI operations or pywin32 dependencies.
Settings & Data Storage
All settings and data are stored locally:
Settings File: ~/.grok_snap_chat/settings.json
API key (plain text—stored in your user directory)
Snap position preference
Opacity level
Conversations: ~/Documents/Grok Snap Chat Conversations/
Timestamped JSON files with full conversation history
Includes both raw API messages and formatted display text
Easy to backup, move, or share
API Integration
Grok Snap Chat uses xAI’s /v1/chat/completions endpoint with the grok-2-vision-1212 model, which handles both:
Regular text conversations
Vision requests with images
For vision requests, the image is sent in the message content array:
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}},
{"type": "text", "text": "Analyze this window..."}
]
}All API calls run in separate threads to keep the UI responsive, and the full conversation history is maintained for context.
UI Architecture
Built with PyQt6 for a modern, native Windows feel:
Frameless window with custom title bar
“Always on top” flag to stay visible
Custom dark theme matching professional development tools
HTML-formatted chat display for rich message rendering
Real-time opacity adjustments via Qt’s
setWindowOpacity
Performance Considerations
Grok Snap Chat is surprisingly lightweight:
Memory footprint: 50-80MB typical
CPU usage: Negligible (position checking runs every 100ms)
Network: Only when sending API requests
Storage: No local storage—everything is in memory
The window position monitoring runs on a QTimer that fires 10 times per second. This is frequent enough to feel instantaneous when moving windows, but infrequent enough to have minimal CPU impact.
Privacy and Security
A few important notes:
API Key Storage: Your xAI API key is stored in plain text in
~/.grok_snap_chat/settings.jsonwithin your user directory. Only your Windows account can access this file. If you want to remove it, either delete the file or clear the key in Settings and save.Screenshots are ephemeral: Window captures are converted to base64 and sent to xAI’s API, but nothing is stored locally
Conversation history: Saved conversations are stored as JSON files in your Documents folder only when you explicitly save them. Unsaved chats are kept in memory only and cleared when you close the app or click “Clear Chat”
No telemetry: The app doesn’t collect any usage data or phone home
Local settings: All preferences are stored locally on your machine, not in the cloud
Future Enhancements
I’m actively developing Grok Snap Chat. Here are features recently completed and what’s coming next:
Recently Completed:
✅ Multi-position snapping (left, right, top, bottom)
✅ In-app API key management with persistent storage
✅ Save and load conversations with timestamps
✅ Opacity controls for window transparency
✅ Auto-window detection based on hover position
✅ Easy access to conversations folder
Coming Soon:
Multi-monitor support with intelligent positioning
Custom keyboard shortcuts for common actions
Window filters to exclude certain application types
Multiple simultaneous chats for different windows
Minimize to system tray for quick access
Auto-snap based on active window detection
Theme customization options with color schemes
Export conversations to various formats (PDF, markdown)
If you have ideas or feature requests, feel free to open an issue on the GitHub repository!
Known Limitations
Nothing’s perfect. Here are the current limitations:
Windows only: Uses Windows-specific APIs (though a cross-platform version is theoretically possible)
Elevated windows: Can’t snap to UAC prompts or other elevated windows due to Windows security
Fullscreen apps: Some fullscreen applications may cover the chat pane
Manual window selection: You need to manually choose which window to snap to (auto-detection coming)
Screenshot limitations: Captures what’s visible on screen, not underlying content (can’t see through overlapping windows)
Why I Built This
I’ve been working with AI tools daily for the past couple of years, and one thing that frustrated me was the constant context switching. Whether I was coding, writing, or analyzing data, I had to stop what I was doing, switch to a chat interface, describe what I was looking at, and then switch back.
With Grok Snap Chat, the AI is always there, always seeing what I’m seeing, and always ready to help. It’s like having a knowledgeable colleague looking over your shoulder—but one who never gets tired, never judges, and has instant access to vast amounts of knowledge.
The vision capability takes this to another level. Instead of describing what’s on my screen or copy-pasting content, I just click “Analyze” and Grok sees it all. It’s remarkably liberating.
Try It Yourself
Grok Snap Chat is completely free and open source. I’ve released it as part of my JunkDrawer repository—a collection of practical AI tools and experiments.
Get started:
Visit https://github.com/rod-trent/JunkDrawer/tree/main/Grok%20Snap
Download the files
Run
setup.bat(orpip install -r requirements.txt)Run
python grok_snap_chat.pyClick Settings (⚙️) and enter your xAI API key
Start snapping and chatting!
That’s it. Within minutes, you’ll have an AI assistant that can see your screen and help with whatever you’re working on. No complex configuration, no environment variables to set, no hidden setup steps.
Contributing and Feedback
This is an evolving project, and I’d love your input:
Found a bug? Open an issue on GitHub
Have a feature idea? Submit a feature request
Want to contribute? Pull requests are welcome
Just want to chat about it? Reach out on social media or via my blog
I’m particularly interested in hearing about interesting use cases I haven’t thought of. How are you using Grok Snap Chat? What workflows has it improved?
Final Thoughts
Grok Snap Chat represents a shift in how we interact with AI assistants. Instead of AI being a separate destination we visit, it becomes a persistent companion that’s always available, always aware of our context, and always ready to help.
The ability to snap to any window and actually see what’s on screen opens up possibilities that weren’t practical before. It’s the difference between describing a problem and showing a problem—and we all know showing is more effective.
If you spend your day working with information—reading, writing, coding, analyzing, creating—Grok Snap Chat might just become your new favorite productivity tool.
Give it a try and let me know what you think!
Support: If you find this useful, star the repository on GitHub and share it with others who might benefit!



