Codex for VS Code
An independent, open-source Codex client for VS Code. Use your local Codex CLI
and its existing sign-in to chat about code, review proposed edits, manage sessions
and work with editor context. The interface follows VS Code's language and theme,
with English and Simplified Chinese support.
This project is not affiliated with or endorsed by OpenAI.
See release acceptance for verified platforms, runtime
versions and known limitations.
Features
- Chat in the right sidebar or an editor tab, with a separate Sessions & Usage
panel in the Activity Bar. Keep independent drafts, tabs, groups and bookmarks.
- Stream responses and tool activity; select models and reasoning levels exposed
by your runtime; queue, steer or interrupt a running turn.
- Review native proposed file changes in VS Code's diff editor before approval.
Inspect changed files, undo eligible edits, or rewind a conversation and its
recorded edits while preserving later manual changes.
- Attach the active editor selection, choose workspace files with
@, paste images,
inspect diagnostics, and add excerpts of an assistant response to your next message.
- Browse workspace history, rename/archive/fork chats, export messages and plans,
inspect native child tasks, and view account limits and token usage.
- Reuse native Codex MCP configuration and credentials, discover Skills, answer
supported MCP forms, and manage
supported native Hooks, plugins and agent definitions.
- Browse local Codex memories without editing them. Dictation depends on runtime,
account and microphone support.
Feature availability depends on your Codex runtime, provider and account. The
feature ledger preserves the complete roadmap; it is
not a claim that every reference feature is implemented.
Requirements and setup
- Install VS Code 1.142.0 or newer and the official Codex CLI 0.152.0 or newer.
- Run
codex login in a terminal. The extension reuses the CLI's existing sign-in;
it does not create another account or provide a billing service. API-key usage
follows your provider's billing policy.
- Install Codex for VS Code by RowanHuang from the
VS Code Marketplace,
or install a release VSIX using Extensions: Install from VSIX….
- Open a trusted local folder, then choose Codex for VS Code: Open Chat from
the Command Palette or click the extension's Activity Bar icon.
If Codex cannot be found, set independentCodex.runtimePath to your executable.
The CLI and editor must use the same OS user and CODEX_HOME. The Codex home and
workspace must be separate directories, with neither containing the other.
On macOS, automatic discovery can also select an installed desktop runtime;
an explicit runtime path takes precedence.
Existing MCP connections
The extension discovers the MCP servers already configured in your native Codex
home and lets the runtime reuse its stored credentials. You do not need to add
those servers again. Approve access for the workspace before using their tools;
this is a local trust decision, not another service account. If the native
runtime requires sign-in again, use the server’s OAuth action. Desktop app
connectors and local CLI MCP servers are distinct integrations; availability
depends on the selected runtime.
Review and recovery
New chats default to Ask before edits. A native file-change approval opens
VS Code's diff editor; accept or reject the entire proposed change. Edit
automatically permits native edits according to Codex policy. Plan mode
uses the runtime's planning behavior. The setting
independentCodex.initialPermissionMode controls the default.
Undo changes and Rewind to here restore only eligible file edits with
known before/after contents and unchanged current text. Dirty buffers, later manual
edits, unsafe paths and unknown outcomes block restoration. Shell effects,
renames, binary files and edits without an exact pre-image are not recoverable.
Multi-file restoration is not crash-atomic. Keep normal version-control backups.
History opens without starting work; sending a message acquires the runtime's
writer. A chat active in another client may remain read-only until that client
releases it. Reconnection never automatically replays an unknown request.
Shortcuts and settings
| Action |
macOS |
Windows / Linux |
| Focus chat |
Cmd+Esc |
Ctrl+Esc |
| Open editor chat |
Cmd+Shift+Esc |
Ctrl+Shift+Esc |
| Attach selection |
Alt+K |
Alt+K |
| Accept focused proposed diff |
Cmd+Enter |
Ctrl+Enter |
| Reject focused proposed diff |
Cmd+Backspace |
Ctrl+Backspace |
Open Settings → Extensions → Codex for VS Code for runtime path, locale,
send key, initial permission mode, autosave and editor context preferences.
UI locale does not change model response or speech language.
Boundaries
- Local desktop workspaces only; remote and virtual hosts are unsupported.
- The tested platform/runtime matrix is listed in
release acceptance. A passing build is not an OS test.
- The runtime controls model access, tools and permissions. Trusted Hooks, plugins,
MCP servers and shell commands can have effects outside file-edit review.
- Local Codex memory is separate from ChatGPT web memory. Advanced plugin/app auth,
arbitrary MCP schemas, full reference parity and screen-reader acceptance remain
incomplete. Real dictation and OAuth checks cover the specific host and provider
recorded in release acceptance; they do not certify every device or service.
- Runtime read-only mode is not a workspace-only read sandbox. Prompts and selected
context are sent to the configured provider when you send a message.
Read privacy, security and
runtime support before enabling external tools.
Development
Use Node.js 22+:
npm ci
npm run check # TypeScript, offline regressions, production bundles
npm run test:editor # isolated VS Code extension-host tests
npm run release:local # checks, VSIX, allowlist verification and SHA-256
The extension uses TypeScript, React and esbuild. Codex owns conversation history;
there is no separately hosted server or conversation database. Runtime binaries
are installed separately. See contributing for editor, runtime
and platform checks, and architecture for the code map.
Support and license
Report reproducible bugs through GitHub Issues.
Do not include credentials or private conversations. See SECURITY.md
for reporting sensitive issues. Original code is MIT licensed; generated protocol
types and bundled dependencies retain their third-party licenses.