<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj" -->

---
title: How to Use Codex in VS Code: From First Task to Reliable...
description: A practical walkthrough covers installing the official openai.chatgpt Codex extension in VS Code, distinguishing Agent mode from inline autocomplete, and...
canonical: https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Use Codex in VS Code: From First Task to Reliable Agent Workflow | daily.dev
og:description: A practical walkthrough covers installing the official openai.chatgpt Codex extension in VS Code, distinguishing Agent mode from inline autocomplete, and...
og:url: https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj
og:image: https://api.daily.dev/og/posts/rW0NBdzWJ.png
og:image:alt: How to Use Codex in VS Code: From First Task to Reliable Agent Workflow
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Use Codex in VS Code: From First Task to Reliable Agent Workflow

**[Medium](https://daily.dev/sources/medium_js)** · 24 min read · 1 upvotes · 1 comments

## Summary

A practical walkthrough covers installing the official openai.chatgpt Codex extension in VS Code, distinguishing Agent mode from inline autocomplete, and setting up a safe first task with a recovery point via Git. It details authentication routes (ChatGPT login vs API key), shared configuration through ~/.codex/config.toml and auth.json, choosing between local agent, cloud delegation, and CLI, and troubleshooting common failures: approval-loop friction, a Windows 11 WSL infinite-loading bug (issue #7082), hidden sidebar icons, unsupported-model 400 errors, a roughly 5-minute /review timeout in the sidebar, and remote SSH/headless authentication via port forwarding on 1455. It also notes JetBrains IDEs gained native Codex support starting version 2025.3 in January 2026, while Visual Studio Community 2022 remains unsupported.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://pub.towardsai.net/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-3f31c424d11a>

## Questions this post answers

### How do I fix Codex extension stuck on Loading forever in VS Code on Windows 11?

Disable the Run Codex In Windows Subsystem For Linux setting by opening VS Code Settings and searching Codex WSL, then reopen the Codex panel in the intended runtime. This was isolated to the WSL integration setting in GitHub issue openai/codex#7082; if the CLI still starts but the panel stays stuck, it's a WebView or extension issue rather than an auth problem.

_Developers untangling agent extension bugs can find version-specific fixes like this one on daily.dev._

### How do I authenticate the Codex VS Code extension over remote SSH or vscode-server when browser login fails?

Forward port 1455 using VS Code's PORTS view (Forward a Port) so localhost:1455 resolves on the remote machine, then run codex login and complete the browser step on a machine that has one. If port forwarding fails, copy ~/.codex/auth.json from a working local login into the remote extension's auth.json path instead.

_Anyone wiring up remote dev environments can track auth workarounds like this one via daily.dev._

### Does using an OpenAI API key instead of ChatGPT login work the same way in the Codex VS Code extension?

No, API-key billing in the extension and CLI drops cloud delegation and GitHub code review compared to a ChatGPT plan login. Set preferred_auth_method = "apikey" in ~/.codex/config.toml and place the key in ~/.codex/auth.json, or export OPENAI_API_KEY in the shell before launching code . Choose this route only when a ChatGPT quota is exhausted or a team already bills through the API.

_Teams weighing API-key versus subscription auth for coding agents can compare tradeoffs on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@emmanuelokoh** · 0 upvotes

> I love what you are doing

## Similar posts on daily.dev

- [Giving OpenAI codex a try in VSCode](https://daily.dev/posts/giving-openai-codex-a-try-in-vscode-s6c6wvm5z) · The Art of Simplicity · 2 upvotes · 0 comments
- [Codex is now the recommended agent in JetBrains IDEs](https://daily.dev/posts/codex-is-now-the-recommended-agent-in-jetbrains-ides-q3gxvk24g) · JetBrains · 1 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#openai](https://daily.dev/tags/openai), [#vscode](https://daily.dev/tags/vscode), [#openai-codex](https://daily.dev/tags/openai-codex)

[View this post on daily.dev](https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Use Codex in VS Code: From First Task to Reliable Agent Workflow","url":"https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj"},"datePublished":"2026-09-14T21:09:59.532Z","dateModified":"2026-09-14T21:30:10.374Z","description":"A practical walkthrough covers installing the official openai.chatgpt Codex extension in VS Code, distinguishing Agent mode from inline autocomplete, and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/dcc5a29551cbb48e18f919a1b0a3ffc5?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/dcc5a29551cbb48e18f919a1b0a3ffc5?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"ai-agents,openai,vscode,openai-codex","timeRequired":"PT24M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"How to Use Codex in VS Code: From First Task to Reliable Agent Workflow"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj","comment":[{"@type":"Comment","text":"I love what you are doing","datePublished":"2026-09-21T15:50:30.065Z","url":"https://daily.dev/posts/rW0NBdzWJ#c-JSf8LBKFw","author":{"@type":"Person","name":"Emmanuel Okoh","url":"https://daily.dev/emmanuelokoh","image":"https://lh3.googleusercontent.com/a/ACg8ocI7gDB10Ku3vVatsIWFbcsQ7Z0toRvhJYFJrZDfGLLMDKyzqXKQ=s96-c"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-use-codex-in-vs-code-from-first-task-to-reliable-agent-workflow-rw0nbdzwj#faq","mainEntity":[{"@type":"Question","name":"How do I fix Codex extension stuck on Loading forever in VS Code on Windows 11?","acceptedAnswer":{"@type":"Answer","text":"Disable the Run Codex In Windows Subsystem For Linux setting by opening VS Code Settings and searching Codex WSL, then reopen the Codex panel in the intended runtime. This was isolated to the WSL integration setting in GitHub issue openai/codex#7082; if the CLI still starts but the panel stays stuck, it's a WebView or extension issue rather than an auth problem. Developers untangling agent extension bugs can find version-specific fixes like this one on daily.dev."}},{"@type":"Question","name":"How do I authenticate the Codex VS Code extension over remote SSH or vscode-server when browser login fails?","acceptedAnswer":{"@type":"Answer","text":"Forward port 1455 using VS Code's PORTS view (Forward a Port) so localhost:1455 resolves on the remote machine, then run codex login and complete the browser step on a machine that has one. If port forwarding fails, copy ~/.codex/auth.json from a working local login into the remote extension's auth.json path instead. Anyone wiring up remote dev environments can track auth workarounds like this one via daily.dev."}},{"@type":"Question","name":"Does using an OpenAI API key instead of ChatGPT login work the same way in the Codex VS Code extension?","acceptedAnswer":{"@type":"Answer","text":"No, API-key billing in the extension and CLI drops cloud delegation and GitHub code review compared to a ChatGPT plan login. Set preferred_auth_method = \"apikey\" in ~/.codex/config.toml and place the key in ~/.codex/auth.json, or export OPENAI_API_KEY in the shell before launching code . Choose this route only when a ChatGPT quota is exhausted or a team already bills through the API. Teams weighing API-key versus subscription auth for coding agents can compare tradeoffs on daily.dev."}}]}
```

