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

Context

@file Mentions

Type @filename to attach workspace files. Autocomplete popup with fuzzy search. Up to 3 attachments, 100 KB each.

Memory

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

  1. Select text in any terminal pane (mouse drag or Ctrl+Shift+A then trim).
  2. Right-click → Send to AI (bold menu item with sparkles icon).
  3. Glitch checks for a valid API key. If missing, shows red toast: "AI Locked: Missing API Key".
  4. If the AI panel is closed, it opens automatically.
  5. Selected text is placed in the input field. If it doesn't already start with /shell, Glitch adds the prefix.
  6. 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

ModeTriggerBehavior
ChatDefault - any message without /shell prefixGeneral workspace-aware assistance. Uses attached @files and your project context.
/shellPrefix message with /shell or use Send to AIDiagnostic 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_hidden in 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

FeatureDetails
TriggerType @ followed by a filename or path fragment in the AI input.
AutocompletePopup list filters workspace files by fuzzy match. Arrow keys + Enter to select.
Quoted pathsPaths with spaces use @'path with spaces' syntax.
Attachment chipsSelected files appear as chips below the input. Visible in sent messages too.
Remove attachmentBackspace at end of input removes the last attachment chip.
LimitsMaximum 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

FeatureDetails
StorageOne JSON file per day in the Glitch config directory.
RestoreToday's messages load when the AI panel opens (if API key is set).
PruningHistory files from previous days are automatically deleted; only today is kept.
Attachments in historyFile 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

ActionKey
Send messageEnter
New line in inputShift+Enter
Stop streaming responseEnter (while streaming)
@mention autocompleteType @, use arrow keys, Enter to select
Remove last attachmentBackspace at end of empty input

Related