Answer: For a "Failed to connect to IDE companion extension" error, make sure the Gemini CLI Companion extension is installed and enabled in your IDE, then open a new terminal window in your IDE so it picks up the correct environment. For an "IDE connection error" where the connection was lost unexpectedly, run /ide enable to reconnect; if the issue continues, open a new terminal window or restart your IDE. Status: Confirmed Entry: tool/gemini-cli/troubleshooting/vscode-connection-errors Revision: 1 Digest: sha256:558918775dc0be2d (changes whenever the content changes) Timeline: Created: 2026-11-13T12:40:36Z Last changed: 2026-11-13T12:40:36Z Last verified: 2026-11-20T12:53:11Z Next check: 2026-11-21T12:53:11Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of First error message | 🔴 Disconnected: Failed to connect to IDE companion extension in [IDE Name]. Please ensure the extension is running. To install the extension, run /ide install. | [1] | 2026-11-20 First error cause | GEMINI_CLI_IDE_WORKSPACE_PATH | [1] | 2026-11-20 First solution step 1 | Gemini CLI Companion | [1] | 2026-11-20 First solution step 2 | Open a new terminal window in your IDE to ensure it picks up the correct environment. | [1] | 2026-11-20 Second error message | 🔴 Disconnected: IDE connection error. The connection was lost unexpectedly. Please try reconnecting by running /ide enable | [1] | 2026-11-20 Second solution | /ide enable | [1] | 2026-11-20 Sources: [1] Google. "IDE Integration". https://geminicli.com/docs/ide-integration.md Role: primary. Accessed: 2026-11-20T12:53:11Z Quote: "🔴 Disconnected: Failed to connect to IDE companion extension in [IDE Name]. Please ensure the extension is running. To install the extension, run /ide install." (Supports: First error message) Quote: "Gemini CLI could not find the necessary environment variables (`GEMINI_CLI_IDE_WORKSPACE_PATH` or `GEMINI_CLI_IDE_SERVER_PORT`) to connect" (Supports: First error cause) Quote: "Make sure you have installed the **Gemini CLI Companion** extension in your IDE and that it is enabled." (Supports: First solution step 1) Quote: "Open a new terminal window in your IDE to ensure it picks up the correct environment." (Supports: First solution step 2) Quote: "🔴 Disconnected: IDE connection error. The connection was lost unexpectedly. Please try reconnecting by running /ide enable" (Supports: Second error message) Quote: "Run `/ide enable` to try and reconnect. If the issue continues, open a new terminal window or restart your IDE." (Supports: Second solution) Published: 2026-10-16T02:36:07Z Snapshot SHA-256: 728a2d5a6c07d06bb4a6621f74ed548c491c639f0161d4865ce42108bf08cd79 (captured 2026-11-13T03:18:37Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T12:40:36Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:53:11Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:53:11Z Last attempt: 2026-11-20T12:53:11Z Notes and limitations: Extracted automatically from a single official source (section "Connection errors"). Related: https://latestn.com/tool/gemini-cli/troubleshooting/web-tools-troubleshooting How do I troubleshoot errors when using Gemini CLI web search and fetch? https://latestn.com/tool/github-copilot/account-and-plans/access-copilot-free-in-ide How do I access GitHub Copilot Free in Visual Studio or VS Code? https://latestn.com/tool/github-copilot/account-and-plans/agent-apps-access-billing Who can use agent apps in GitHub Copilot and how is billing handled? https://latestn.com/tool/gemini-cli/troubleshooting/view-traces-genkit How do I view Gemini CLI traces using Genkit? https://latestn.com/tool/gemini-cli/troubleshooting/view-traces-google-cloud How do I view Gemini CLI traces using Google Cloud? https://latestn.com/tool/gemini-cli/troubleshooting/view-traces-jaeger How do I view Gemini CLI traces using Jaeger? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T12:40:36Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/gemini-cli/troubleshooting/vscode-connection-errors/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/gemini-cli/troubleshooting/vscode-connection-errors POST: https://latestn.com/dispute/tool/gemini-cli/troubleshooting/vscode-connection-errors with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/gemini-cli/troubleshooting/vscode-connection-errors?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I troubleshoot connection errors with the Gemini CLI VS Code companion extension? Revision 1, last verified 2026-11-20T12:53:11Z. https://latestn.com/tool/gemini-cli/troubleshooting/vscode-connection-errors (accessed 2026-11-21T09:53:40Z). @misc{LatestN_tool_gemini_cli_troubleshooting_vscode_connection_errors_r1, title = {How do I troubleshoot connection errors with the Gemini CLI VS Code companion extension?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/gemini-cli/troubleshooting/vscode-connection-errors}}, note = {Revision 1; digest sha256:558918775dc0be2d; last verified 2026-11-20T12:53:11Z; accessed 2026-11-21T09:53:40Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/gemini-cli/troubleshooting/vscode-connection-errors