Glitch AI Assistant
Glitch AI is a built-in assistant that runs in a side panel alongside your terminal. It is workspace-aware - your project and terminal context are included automatically with every request.
Signature Features
Send to AI
Select terminal output → right-click → Send to AI. Glitch prefixes /shell, opens the AI panel, and places the text in the input field ready to send.
/shell Diagnostic Mode
Prefix any message with /shell (or use Send to AI) to analyze terminal output - build logs, errors, stack traces, command results.
@file Mentions
Type @filename to attach workspace files. Autocomplete popup with fuzzy search. Up to 3 attachments, 100 KB each.
10-Turn Rolling Memory
Last 10 user/assistant turns sent with every request for conversational continuity within a session.
Send to AI - Step by Step
- Select text in any terminal pane (mouse drag or Ctrl+Shift+A then trim).
- Right-click → Send to AI (bold menu item with sparkles icon).
- Glitch checks for a valid API key. If missing, shows red toast: "AI Locked: Missing API Key".
- If the AI panel is closed, it opens automatically.
- Selected text is placed in the input field. If it doesn't already start with
/shell, Glitch adds the prefix. - Input field receives focus. Press Enter to send.
Send to AI is disabled when no text is selected. The menu item appears grayed out until you make a selection.
Chat Mode vs /shell Mode
| Mode | Trigger | Behavior |
|---|---|---|
| Chat | Default - any message without /shell prefix | General workspace-aware assistance. Uses attached @files and your project context. |
| /shell | Prefix message with /shell or use Send to AI | Diagnostic mode for terminal output - focused fixes for errors, brief summary for successful output. |
Use /shell when sending terminal output; use chat mode for everything else.
API Key & Unlock Flow
- Locked state - AI panel shows unlock UI when no API key is configured.
- Inline unlock - enter key directly in the AI panel without opening Settings.
- Settings path - Settings → AI Core Setup → paste key and select model.
- Key masking - API key field supports show/hide toggle (
ai.api_key_hiddenin config). - Local storage - key saved in
~/.config-vritrasecz/Glitch/.
Model Selection
Choose your model via Settings → AI Core Setup or the model dropdown in the AI panel header. Available models sync automatically on launch. Model choice persists across sessions.
@file Mentions & Attachments
| Feature | Details |
|---|---|
| Trigger | Type @ followed by a filename or path fragment in the AI input. |
| Autocomplete | Popup list filters workspace files by fuzzy match. Arrow keys + Enter to select. |
| Quoted paths | Paths with spaces use @'path with spaces' syntax. |
| Attachment chips | Selected files appear as chips below the input. Visible in sent messages too. |
| Remove attachment | Backspace at end of input removes the last attachment chip. |
| Limits | Maximum 3 attachments per message. Each file max 100 KB. Content read from disk at send time. |
| Highlighting | @mention tokens highlighted in theme accent color (semibold) in the input field. |
Streaming & Response UI
- Streaming responses - AI replies appear word-by-word as they are generated.
- Processing animation - while waiting, status cycles: "processing", "analyzing", "thinking", "routing" with animated dots.
- Stop stream - press Enter while a response is streaming to cancel.
- Markdown rendering - headings, bold, italic, inline code, fenced code blocks, and tables rendered in the chat feed.
- Syntax highlighting - fenced code blocks are highlighted in monokai style.
- Per-code-block copy - each code block has its own copy button.
- Copy full response - copy button on assistant messages copies the entire response text.
- Use Again - button on user messages re-inserts that message into the input field.
- Fold long messages - very long user messages show a "Show full message" expander.
- Scroll to bottom - floating button appears when you've scrolled up in the chat feed.
- Selectable text - all message content is selectable for manual copy.
- SYSTEM errors - error rows displayed in red styling in the chat feed.
Empty State & Quick Chips
When the chat feed is empty and the API key is set, Glitch shows an empty state with suggestion chips:
- Shell - example shell diagnostic prompt
- Debug - example debugging prompt
- Git - example git workflow prompt
Clicking a chip pre-fills the input field.
Conversation Memory
Glitch remembers the last 10 exchanges within your current session so follow-up questions stay in context.
When you reopen the AI panel, today's chat history is restored automatically.
Daily Chat History
| Feature | Details |
|---|---|
| Storage | One JSON file per day in the Glitch config directory. |
| Restore | Today's messages load when the AI panel opens (if API key is set). |
| Pruning | History files from previous days are automatically deleted; only today is kept. |
| Attachments in history | File attachments are saved with messages and restored when you reopen the panel. |
Workspace Awareness
Glitch AI automatically includes context from your active terminal - working directory, project files, and environment - so you do not need to paste it manually. Attach specific files with @filename when you want the AI to read them directly.
Input Controls
| Action | Key |
|---|---|
| Send message | Enter |
| New line in input | Shift+Enter |
| Stop streaming response | Enter (while streaming) |
| @mention autocomplete | Type @, use arrow keys, Enter to select |
| Remove last attachment | Backspace at end of empty input |