Guide
Codex CLI sessions in VS Code: extension, terminal or a grid
There are three ways to use Codex in VS Code: OpenAI's Codex extension (a chat in the sidebar), the Codex CLI in the integrated terminal, or several CLI sessions side by side in a grid. The extension suits one task at a time with your editor context; the CLI is the one to script, resume and run in parallel. This guide follows OpenAI's IDE and CLI documentation (checked 24 October 2026).
1. The Codex extension
Install the extension from the Visual Studio Marketplace (it is listed as openai.chatgpt); OpenAI also links installs for Cursor and Windsurf. Select the Codex icon, or run Codex: Open Codex Sidebar from the Command Palette, sign in, and start a chat with the files you have open as context. OpenAI's page does not say whether the extension runs on Windows, so check its listing for your platform.
2. The CLI in the integrated terminal
Install the CLI (on macOS and Linux: curl -fsSL https://chatgpt.com/codex/install.sh | sh; the docs have Windows, npm and Homebrew tabs), then run codex in your project's folder and choose Sign in with ChatGPT the first time. Useful commands from the docs:
codex resume: reopen a recent chat from the current repository, or search your local chats./permissions: choose when Codex may edit files or run commands without asking, and inspect the active sandbox./init: create anAGENTS.mdwith instructions for Codex in this project./status: shows your usage limits; see Codex CLI usage limit.
The terminal is what you want when a task is long, when you want to resume it tomorrow, or when you run more than one.
3. Several sessions in a grid
Two Codex sessions in one editor terminal panel means tabbing between them and noticing, late, that one has been waiting for approval. Paneherd opens each CLI session as a terminal in the editor area, in a grid. Its sidebar shows which Codex panes are working, waiting for you or finished, from Codex's own hook events (Codex asks once whether to trust new hooks). You can send one prompt to several panes, restart a pane into the same conversation, and keep Codex's usage windows in view at the top of the sidebar. The free version runs up to four panes of any agent.
Parallel Codex sessions: two cautions
- Files. Sessions in one checkout can overwrite each other. Give each its own git worktree (
git worktree add ../app-b -b task-b) and start Codex inside it. - Limits. The limits belong to your ChatGPT account, so every session draws on the same windows. Check them before starting another.
Frequently asked questions
Extension or CLI?
The extension for quick tasks with editor context; the CLI for long, resumable or parallel work. They are separate surfaces, and OpenAI's page does not describe shared sessions between them.
Does it work in Cursor?
Yes: OpenAI lists the extension for Cursor, and the CLI runs in Cursor's terminal. Paneherd runs in Cursor too.
Next: run Codex and Claude Code together and check Codex's usage limits.