Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Grok AI / xAI for VS CodeNew to Visual Studio Code? Get it now.
Grok AI / xAI for VS Code

Grok AI / xAI for VS Code

GM DevCore

|
1,788 installs
| (1) | Free
Integrate xAI's Grok into VS Code — chat, explain, generate, fix, and get inline completions.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Grok AI / xAI for VS Code

GMDevCore · GMDevCore.gm-grok-vscode

Integrate xAI's Grok directly into VS Code — sidebar chat, inline completions, code actions, git integration, and more.


✨ What's new in 6.8

The Grok icon is on the left, where you'd expect it. Click it, press Ctrl/Cmd + Alt + G, or click Grok in the status bar to open the chat.

Want the chat open at the same time as your Explorer? Drag the Grok icon from the left activity bar onto the right edge of the window to dock it in the Secondary Side Bar. VS Code remembers where you put it.

A new icon — the Grok mark, crisp at every size and theme-aware in the sidebar.

✨ What's new in 6.7

Cleared a chat by mistake? Get it back. Clearing a chat now shows an Undo option — both in the chat itself and as a notification. Deleting a session is covered too. If you notice later, run Grok: Restore Last Cleared Chat from the Command Palette; the last five cleared transcripts are kept.

Agent work is saved to disk. Every Agent Mode run is written to .grok/runs/ in your project, so what the agent did survives even if the chat is cleared, deleted, or the window is closed. Load any past run back into the chat with Grok: Recover Saved Agent Run.

Agent Mode is much more capable. It now carries out every action in a step instead of just the first, can run for 50 steps (adjustable up to 200), always shows what it's waiting on you to approve, and survives dropped connections mid-run.

Grok 4.6 and cheaper conversations. The newest flagship model is the default, prompt caching cuts the cost of long chats substantially, and a ⚡ cached badge shows it working.


Changelog

v6.8.4 — Grok icon is back on the left

  • Fixed 6.8.0 moved the chat to the Secondary Side Bar to stop it replacing the Explorer, but that bar is hidden by default and is often already taken by another extension — so the Grok icon simply disappeared. It's back in the left activity bar where you'd expect to find it
  • Changed If you do want the chat visible alongside the Explorer, drag the Grok icon to the right edge of the window to dock it in the Secondary Side Bar. A one-time tip now points this out, and VS Code remembers your choice
  • Kept Ctrl/Cmd + Alt + G, the status bar button, and Grok: Show Chat Panel all open the chat wherever you've placed it

v6.8.3 — Finding the chat after it moved

  • Fixed After 6.8.0 moved the chat to the Secondary Side Bar, the Grok icon disappeared from the left with nothing appearing on the right — because that bar is hidden by default in VS Code. The chat is now revealed automatically the first time you run this version, with a one-time note explaining where it went
  • Added Ctrl/Cmd + Alt + G opens the chat from anywhere, showing the Secondary Side Bar if it's hidden. The same is available as Grok: Show Chat Panel in the Command Palette
  • Changed Clicking Grok in the status bar now reliably opens the chat rather than assuming the panel is already visible

v6.8.2 — Grok icon

  • Changed The extension now uses the Grok mark for both its marketplace icon and its sidebar button. The sidebar version is a true vector, so it stays sharp at any size and picks up your theme's colour automatically

v6.8.1 — Hollow icon

  • Changed The extension and sidebar icons are now an outlined (hollow) version of the angular mark, which reads more clearly at small sizes and against both light and dark backgrounds

🪟 v6.8.0 — Chat sits beside your files, not on top of them

  • Fixed Opening Grok Chat replaced the Explorer, because VS Code only shows one panel at a time in the left sidebar. The chat now lives in the Secondary Side Bar on the right, so the Explorer and the chat are visible together. You can drag it back to the left sidebar if you preferred it there
  • Changed Every command that opens the chat (code actions, CodeLens, git, terminal, diagnostics, Agent Mode) now reveals it reliably in its new home
  • Changed New extension and sidebar icons — a cleaner angular mark that stays legible at small sizes and adapts to light and dark themes

🩹 v6.7.2 — Fixes agent runs stopping dead mid-task

  • Fixed Long agent runs could stop with no message and no error around turn 7–8. The extension's context trimmer was mis-measuring how much it had removed, so once a run got large it stripped away nearly the whole conversation — leaving the request in a state the API answers with nothing at all
  • Fixed The trimmer could separate an action from its result, which also produces an empty reply. Any unpaired item is now removed before the request is sent
  • Changed Agent runs keep far more context before trimming (models now hold 500k–1M tokens, so the old limit was needlessly tight). Longer tasks stay coherent and prompt caching keeps working
  • Added If the model ever does return an empty reply, the agent recovers automatically and retries instead of stopping silently. If it happens twice it tells you plainly, confirms your work is saved, and suggests sending continue

🗂 v6.7.1 — Agent runs are saved to your project

  • Added Every Agent Mode run is now written to .grok/runs/ in your workspace as a dated Markdown file — the task and the full transcript of what the agent did. This survives clearing the chat, deleting the session, and closing VS Code
  • Added Grok: Recover Saved Agent Run in the Command Palette lists your saved runs and loads any of them back into the chat. The 20 most recent runs are kept
  • Added If you clear the chat while the agent is still working, its output is no longer orphaned — when the run finishes you're offered a one-click Show in chat to put it back

🛟 v6.7.0 — Undo for cleared chats

Clearing a chat is no longer permanent. When you clear a chat, an Undo link now appears at the top of the chat panel and as a notification — one click puts everything back. The same protection applies when you delete a session.

If you only notice later, run Grok: Restore Last Cleared Chat from the Command Palette. The extension keeps the last five cleared or deleted transcripts, so you can recover even after moving on. Restoring puts the messages back into your current session.

Note: this protects chats cleared from this version onward.

v6.6.5 — Agent gets much further before pausing

  • Fixed When Grok asked to do several things at once, only the first was carried out and the rest were thrown away — so a big task burned through its step budget doing a fraction of the work. All of the actions in a step now run, in order, each still asking for approval in 🤖 Agent mode
  • Changed The step limit is raised from 20 to 50, and is now adjustable in Settings (Grok: Agent Max Turns, up to 200) for large multi-file projects
  • Changed Hitting the limit no longer looks like a failure. The agent explains it paused at a safety limit and tells you to send continue to carry on from where it stopped

v6.6.4 — Agent Mode approvals are reliable again

  • Fixed In 🤖 Agent mode the approval dialog could vanish before you saw it, and the agent would quietly stop after printing its plan instead of asking permission. The cause was the extension force-opening the Output panel on every agent turn, stealing focus from the dialog. It no longer does that
  • Added A yellow "Waiting for your approval" bar now appears at the top of the chat whenever the agent is asking permission, naming the exact action. Even if you miss the dialog, you'll always see that something is waiting on you
  • Changed If an approval dialog is dismissed, the agent now says so clearly and reminds you that ⚡ Auto mode exists if you'd rather not be asked each time

v6.6.3 — Agent runs survive dropped connections

  • Fixed A long agent run could die partway through with a "read ECONNRESET" error. The agent now retries a dropped or rate-limited request automatically (twice, with a short backoff) and carries on where it left off. Retries only happen before any text has appeared, so nothing is ever duplicated
  • Fixed Files written by the agent could be cut off mid-way on larger tasks — the response limit for agent turns was too small for writing whole source files, and is now eight times larger
  • Fixed Tidied up what the extension sends back to xAI after each tool runs, removing fields the API doesn't expect as input

v6.6.2 — Agent Mode diagnostics

  • Changed Agent Mode now recognises every format a Grok model might use to call a tool, not just one — including calls whose arguments arrive in pieces as the response streams
  • Added The "Grok Agent" output panel (View → Output → "Grok Agent") now records the full trace of each run: the request, the HTTP status, every event type received, and the model's complete reply. If the agent finishes without doing anything, the reason is written there
  • Added When the agent ends its first turn without using a tool, it now says so in the chat and points to the output panel, instead of just stopping silently

🔧 v6.6.1 — Agent Mode actually acts again

  • Fixed Agent and Autonomous modes replied with a plan but never did anything. The extension was asking Grok to describe tool calls in a made-up text format — a workaround from an older model generation. Newer Grok models use real function calling instead and simply ignored it, so no action was ever triggered
  • Changed Agent Mode now uses xAI's native function calling: Grok is given proper definitions of every tool it can use (list directory, read file, write file, run command, search files) and calls them directly. Approvals, autonomous mode, and the write-diff preview all work exactly as before
  • Kept The old text-based format still works as a fallback for older models
  • Tip If the agent ever seems stuck, open View → Output → "Grok Agent" to see each turn and tool call as it happens

⚡ v6.6.0 — Grok 4.6, cheaper conversations, deeper thinking

Grok 4.6 is here and is now the default. xAI's newest flagship, built for coding and agentic work — it leads their lineup on coding and has their lowest hallucination rate. Select it from the model picker (make sure it's enabled on your API key at console.x.ai → API Keys → Models).

Your conversations just got cheaper. The extension now uses xAI's prompt caching properly, so the parts of a conversation Grok has already read are billed at a much lower rate instead of full price every time you send a message. In long chats this is a substantial saving. A new ⚡ x% cached badge in the token bar shows how much of your last message was served from cache.

Longer conversations before anything is dropped. Older messages used to get trimmed from long chats fairly aggressively. Now the limit scales to your model's real context window — with Grok 4.6's 500k and Grok 4.3's 1M-token windows, most conversations will never lose earlier context at all. (This also keeps caching working, since trimming old messages is what breaks it.)

A new "xhigh" thinking level. Reasoning Effort now offers xhigh alongside Low, Medium, and High — for the hardest problems where you want Grok to think as long as it needs.

🚨 v6.5.2 — Chat works again (xAI retired their old API)

  • Fixed All chat requests were failing with "HTTP 410" — xAI has retired the API endpoint the extension (and most older Grok tools) used. Chat, Agent Mode, and inline features now run on xAI's current endpoint. If you were seeing 410 errors on every message, this update fixes it
  • Improved The token counter now shows your model's real context window, reported live by xAI — for example the Grok 4.20 models actually have a 1M-token context, much larger than previously assumed
  • Note If you still see errors after updating: check that your models are enabled on your API key (console.x.ai → API Keys → your key → Models dropdown), then run "Grok: Refresh Model List from xAI"

v6.5.1 — Web search fixed

  • Fixed Web search returned an HTTP 410 error — xAI retired the API it used, so web search now runs on xAI's current endpoint. You'll see a "🌐 Searching the web…" indicator while Grok searches (it takes a little longer than a normal reply), then the full grounded answer arrives with its Sources list
  • Improved Finding the error log is now easier to discover: View → Output, then pick "Grok Errors" from the dropdown — or run "Grok: Show Errors Log" from the Command Palette

🌐 v6.5.0 — Live web search and visible reasoning

Grok can now search the web for you. Click the new 🌐 Web button in the input toolbar and Grok will search the internet while answering — perfect for current events, latest library versions, or anything newer than its training data. Answers come back with a Sources list of the pages it used, so you can verify everything with one click. Toggle it off any time to keep responses fully offline.

See when Grok is thinking. Reasoning models (like Grok 4.20 Reasoning) work through a problem before they start writing. Previously that looked like the extension had frozen — now you'll see a "🧠 Reasoning" indicator while the model thinks, which switches to the live response the moment it starts writing.

v6.4.2 — Your model choice is respected

  • Changed When you deliberately pick a model from the picker, the extension now uses it — even if your account's model list hasn't caught up yet. During staged rollouts (like Grok 4.5 right now), xAI's list can lag behind actual availability, and previously the extension would quietly switch you away before even trying
  • Changed If a model genuinely isn't available to your account, the error now says so plainly and points you to the model picker and the "Refresh Model List" command, instead of a vague deprecation warning
  • Important setup step Models must be enabled on your API key before they appear in the extension: go to https://console.x.ai/ → API Keys → click your key → open the Models dropdown → select the chat models you want (e.g. grok-4.5). If a model is missing from the picker or returns errors, this is almost always the fix. The extension's first-run banner and API-key prompts now walk you through this

v6.4.1 — Your model list now matches your account

The model picker now shows exactly what your xAI account can use. Model names are loaded live from xAI, so newly released models appear automatically and ones your account doesn't have won't trip you up. The built-in list was also corrected to the current model names (including the Grok 4.20 "0309" variants and the new Multi-Agent model).

No more errors from unavailable models. If your selected model isn't available on your account (for example, Grok 4.5 hasn't rolled out in your region yet), the extension now automatically switches to the best model you do have — like Grok 4.3 — and tells you, instead of failing with a confusing error.

Pick any model xAI offers. The extension no longer blocks model names it doesn't recognise, so if xAI gives your account something new or unusual, you can select and use it right away — no extension update needed.

✨ v6.4.0 — Speed control, text size, and smoother reading

Choose how hard Grok thinks. A new Reasoning Effort setting (Settings → Grok) lets you pick Low, Medium, or High for Grok 4.5. Low gives you snappy answers for quick questions; High takes longer but thinks a problem through. Applies to both chat and Agent Mode.

Make the chat easier to read. A new Chat Font Size setting (10–20px) adjusts the text size in the chat panel. Changes apply instantly — no reload needed.

Reading old messages no longer fights you. Previously, while Grok was responding, the chat kept yanking you to the bottom even if you'd scrolled up to re-read something. Now the chat only follows the response when you're already at the bottom. When you scroll up, a ↓ button appears — tap it to jump back to the live response.

🚀 v6.3.0 — Grok 4.5 support

  • Added Grok 4.5 — xAI's new flagship for coding and agentic tasks (released July 8), now the default chat model. 500k context, priced $2/$6 per M tokens
  • Added Grok Build 0.1 — xAI's coding-specialised low-cost model, now the default for inline completions and stream-to-editor ($1/$2 per M tokens)
  • Changed Token counter context limit now adapts to the selected model (500k for Grok 4.5, 1M for Grok 4.3, 256k for Grok Build) instead of a hardcoded 128k
  • Changed Cost tracking updated with official per-model pricing from xAI's docs
  • Note Grok 4.5 is not yet available in the EU (xAI expects mid-July); EU users can select Grok 4.3 from the model picker

🏗 v6.2.0 — TypeScript source reconstructed

  • Changed The full TypeScript source has been reconstructed from the compiled output — the project once again has a real build pipeline (npm run compile), type-checking against the VS Code API, and maintainable source files. All 21 modules compile with zero errors and load-verify cleanly
  • Added npm run compile / npm run watch build scripts and a proper tsconfig.json
  • Changed Shipped VSIX now excludes source, sourcemaps, and toolchain files (leaner install); full source is distributed separately

v6.1.8 — Security hardening + inline completion cost fix

  • Security Fixed a path-boundary check in @ file mentions and the agent's write-diff preview — a workspace at /home/user/proj could previously match sibling paths like /home/user/proj-evil; the check now requires a path separator
  • Fixed Inline completions had a debounce timer that was declared but never used — every typing pause fired a full API request. A real 350ms debounce now cancels superseded requests before they reach the API, cutting inline completion cost significantly during active typing

v6.1.7 — Apply-diff fix, agent context capping

  • Fixed The apply button's diff view (when no text was selected) showed a bogus comparison — it diffed an empty virtual document against your live file instead of showing the proposed change. The diff now correctly shows current ↔ proposed content
  • Fixed Long agent runs ballooned the API payload — tool outputs (up to 20 KB each) accumulated across turns and were re-sent on every call. The agent now trims its oldest exchanges mid-run (keeping the system prompt and recent context within a ~12k token budget), so 20-turn sessions stay fast and don't overflow the context window

v6.1.6 — Agent context parity, live model list, polish

  • Fixed Agent Mode ignored .grok/memory.md and @ file mentions — the agent now receives the same project context as regular chat, so it follows your conventions when acting on the workspace
  • Fixed @ mention autocomplete never saw files created after the first fetch — the file list now refreshes automatically (5-second throttle) while you type
  • Changed The in-chat model picker now loads the live model list from your xAI account (cached 5 minutes), so newly released models appear without an extension update; the static list remains as instant fallback
  • Fixed Multiple duplicate "Grok Errors" channels appeared in the Output panel dropdown — all components now share a single channel

v6.1.5 — Usage tracking fix, agent write diffs, smarter sessions

  • Fixed Token usage statistics always showed zero — the tracker was wired up but never actually recorded anything; both regular chat and agent mode now record usage after every exchange
  • Added Agent write_file to an existing file now opens a diff preview (current ↔ proposed) before you decide, with a non-modal Allow / Always allow / Block prompt so you can scroll the diff while deciding
  • Added Sessions are auto-named from your first message (e.g. "fix the login timeout bug…") instead of "Chat 12/05/2026 3:44 PM" — only applies if you haven't renamed the session yourself
  • Fixed Markdown task checkboxes (- [ ] / - [x]) rendered as literal text — now shown as ☐ / ☑

v6.1.4 — Reliability: history cap, retry, real stop

  • Fixed Long conversations could overflow the context window and fail or run up cost — the API now receives a capped window (most recent ~12k tokens / 40 messages); your full chat history is still shown and saved
  • Added Automatic retry with exponential backoff on transient errors (429 rate limits, 500/502/503/504 server errors, and network resets) — up to 2 retries at 800ms then 1600ms
  • Fixed The Stop button now actually aborts the in-flight HTTP request instead of just stopping the display, so no more tokens are consumed after you stop

v6.1.3 — Agent persistence + tool output formatting

  • Fixed Agent stopped after a single tool call instead of continuing — it now persists through multiple tool calls until the task is genuinely complete
  • Fixed Tool output (directory listings, command results) was rendered as a code block with copy/insert/apply buttons — now shown as a clean blockquote
  • Changed System prompt rewritten to emphasise persistence: explore subfolders, chain tool calls, don't stop early or ask the user mid-task
  • Added Loop nudges the model (up to 4 times) if it describes an action without emitting a tool call, and detects genuine completion via summary/question patterns

v6.1.2 — Agent / autonomous mode loop fix

  • Fixed Autonomous mode stopped after the first response — the tool-call parser was too strict and failed on reasoning models that wrap the JSON in markdown fences or format it slightly differently
  • Fixed Agent now retries once if the model describes what it will do instead of acting, nudging it to emit a real tool call
  • Fixed Streaming text no longer drops characters around <tool_call> tag boundaries
  • Changed Parser now handles fenced JSON, bare JSON objects, trailing commas, and validates tool names before executing

✨ v6.1.1 — Slash commands, @ mentions, Apply button, project memory

Four new productivity features:

/ slash commands — type / at the start of the input for an autocomplete menu: /explain, /fix, /test, /docs, /optimize, /review, /commit, /agent, /clear. Arrow keys to navigate, Enter or Tab to select.

@ file mentions — type @ followed by a filename to attach that file as context (e.g. @auth.ts what does this do?). Autocomplete shows matching workspace files; the file's contents are sent with your message.

Apply button on code blocks — every code block now has an apply button alongside copy/insert. With text selected it replaces the selection; with no selection it opens a diff view so you can review before accepting.

Project memory file — run Grok: Create Project Memory File to scaffold .grok/memory.md. Grok reads it automatically and includes it as context in every chat — perfect for teaching it your stack, conventions, and things to avoid. Persists per-project.

v6.0.5 — HTML tag rendering fix

  • Fixed Grok occasionally emitted literal HTML tags like <strong>, <em>, <code> instead of markdown — now converted to markdown equivalents before rendering

v6.0.4 — Dynamic model list

  • Added Grok: Refresh Model List from xAI fetches the real list of models your API key can access

v6.0.3 — Verbose error logging

  • Added Grok Errors output channel logs every error with full HTTP status, response body, and timestamp
  • Added Grok: Show Errors Log command in the Command Palette opens it instantly
  • Changed Generic "An error occurred" replaced with the first 200 chars of the actual error message — fall-through case now shows what really went wrong
  • Added Pattern matching for HTTP 400 / 403 / 404 / 500-class errors with specific guidance for each
  • Added API key validation requests are logged with status code and response body

v6.0.2 — Silent migration + API key validation

  • Added API key is validated against xAI before every chat send (cached per-session). Invalid or expired keys show a clear actionable message instead of a generic error
  • Fixed "Unknown inline model" warning kept appearing for users upgrading from older versions — stale model settings are now silently migrated to grok-4.3 on activation with no warning

v6.0.1 — Model migration fix

  • Fixed Chat threw an error after the v6.0.0 model update — six other files (tokenTracker, chatViewProvider, inlineProvider, streamToEditor, statusBar, configValidator) still hardcoded the old grok-3 defaults and were sending invalid model names to the API
  • Fixed Settings panel showed deprecated models — configValidator allowlist now matches the new model list (grok-4.3, grok-4.20-reasoning, grok-4.20-non-reasoning)
  • Changed Token tracker pricing updated for new models

🚀 v6.0.0 — Major release

  • Changed Models updated to latest xAI lineup — grok-4.3 (default), grok-4.20-reasoning, grok-4.20-non-reasoning; all deprecated models removed
  • Added Token counter now shows percentage of context used (e.g. 4.2k tokens (3%)) with larger, bolder text and a thicker progress bar
  • Added Agent intro banner on first launch — walks new and upgrading users through Agent Mode with a two-column layout and one-click mode activation
  • Fixed Autonomous mode was still showing approval dialogs — check was missing from the callback
  • Fixed Agent button was cut off at minimum sidebar width — moved from header to input toolbar
  • Fixed All overlay panels (Sessions, Templates, Theme) clip-proof via position:absolute inside position:relative wrapper
  • Fixed Sessions dropdown showed only a shadow — root cause was overflow:hidden on all ancestor elements; replaced with full-area overlay
  • Fixed Delete session did nothing — two-click confirm state machine was reset by its own auto-cancel timer; simplified to single-click
  • Fixed Context and Files buttons silently failed — executeCommand indirection blocked when sidebar had focus; now handled directly in provider
  • Fixed No-key banner referenced a non-existent 🔑 icon; replaced with a prominent amber button

🤖 v5.9 — Agent Mode

Let Grok act directly in your workspace. Click Agent in the input toolbar to cycle through three modes:

  • 🤖 Agent (purple) — every action shows an Allow / Always allow / Block dialog
  • ⚡ Autonomous (red war-room) — no approvals, Grok acts immediately; chat turns red
  • Off — standard chat

Tools: read file, write file, run shell command, list directory, search files. All workspace-sandboxed.

v5.7 — Theme system

  • Added 🎨 theme picker with six themes: VS Code Auto (default), Dark, Light, Midnight, Ocean, Warm
  • Fixed "You" bubble invisible on grey/light VS Code themes
  • Fixed Tooltip contrast — fixed dark charcoal background regardless of host theme

Features

💬 Chat Panel

Full sidebar chat with streaming responses, session management, message editing, and export.

  • Named, persistent chat sessions — switch, rename, delete from the All Chats panel
  • Edit any sent message with ✏ — conversation rewinds and regenerates from that point
  • Export chat as Markdown to clipboard or file (Ctrl+Shift+X)
  • In-webview model switcher — click the model chip to change without leaving the sidebar
  • Per-session custom system prompt — override Grok's persona for the current chat
  • Token counter bar shows context usage toward the 128k limit

🤖 Auto File Context

The current open file is automatically included with every message — Grok always knows what you're looking at. A blue 📄 filename chip in the header shows when it's active.

✍️ Code Actions (right-click)

Select any code → right-click → Grok submenu:

Command What it does
Explain Selected Code Plain-English explanation
Refactor Code (Chat) Suggests a cleaner version
Refactor Code (Diff View) Side-by-side diff to review before applying
Fix Bug (Chat / Diff View) Identifies and fixes bugs
Write Unit Tests Comprehensive tests with mocks and edge cases
Add Comments / Docstrings Language-specific documentation
Optimize Code Performance improvements with explanation
Translate to Another Language Convert code to a target language
Explain Error Explains diagnostics at cursor

⚡ Direct Editor Integration

Stream code directly into your file — no copy-paste:

Shortcut Action
Ctrl+Shift+I Generate Code at Cursor — describe what you need
Ctrl+Shift+C Continue Writing — streams a natural continuation
Ctrl+Shift+D Fill TODO — replaces the nearest TODO/FIXME comment

👁 Code Lens

Clickable Explain / Tests / Docs buttons appear above every function and class. Supports TypeScript, JavaScript, Python, Rust, Go, C/C++, C#, Java, Swift, Kotlin, Ruby, PHP, Vue, Svelte.

🔴 Diagnostic Hover

Hover over any red squiggle to get Explain this error and Fix it links inline.

📝 Inline Completions

Copilot-style ghost-text suggestions as you type. Press Tab to accept, Escape to dismiss.

📋 Templates

13 built-in prompt templates (Security Audit, PR Review, Unit Tests, JSDoc, README, etc.) plus custom templates you can save and reuse.

🌿 Git Integration

  • Generate Commit Message — reads your staged diff, writes a Conventional Commits message directly to the SCM input box
  • Explain Diff — explain staged, working tree, or last commit changes
  • Generate PR Description — structured PR template from diff + commits

🖥 Terminal Integration

Right-click in the terminal or use the Command Palette:

  • Explain Terminal Output — what did that command do?
  • Explain Terminal Error — why did it fail?
  • Fix Terminal Error — get a corrected command

📊 Usage Statistics

Local token and cost estimates (no data sent anywhere). Hover the status bar chip or run Grok: Show Usage Statistics.


Setup

  1. Install the extension from the VSIX file
  2. Get your API key from console.x.ai
  3. Press Ctrl+Shift+P → Grok: Set API Key
  4. Click the Grok icon in the Activity Bar, or press Ctrl+Shift+G

Your API key is stored in VS Code's encrypted SecretStorage (OS keychain) — never in settings.json.


Keyboard Shortcuts

Action Windows / Linux macOS
Open Chat Ctrl+Shift+G Cmd+Shift+G
Explain Code Ctrl+Shift+E Cmd+Shift+E
Fix Bug (Diff) Ctrl+Shift+F Cmd+Shift+F
Quick Ask Ctrl+Shift+A Cmd+Shift+A
Use Template Ctrl+Shift+T Cmd+Shift+T
New Chat Ctrl+Shift+N Cmd+Shift+N
Generate at Cursor Ctrl+Shift+I Cmd+Shift+I
Continue Writing Ctrl+Shift+C Cmd+Shift+C
Fill TODO Ctrl+Shift+D Cmd+Shift+D
Export Chat Ctrl+Shift+X Cmd+Shift+X

Settings

Setting Default Description
grok.model grok-4.3 Chat model
grok.inlineModel grok-4.3 Model for inline completions and stream-to-editor
grok.inlineSuggestions true Enable ghost-text completions
grok.codeLens true Show Explain / Tests / Docs above functions
grok.diagnosticHover true Grok actions on error squiggles
grok.autoFileContext true Auto-include current file in every message
grok.maxTokens 4096 Max tokens per response
grok.temperature 0.7 0 = deterministic, 2 = creative

Requirements

  • VS Code 1.85+
  • xAI API key — console.x.ai

Build from Source

npm install
npm install -g typescript @vscode/vsce
npx tsc -p tsconfig.json
vsce package --no-dependencies
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft