Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Codex Two-Account SwitcherNew to Visual Studio Code? Get it now.
Codex Two-Account Switcher

Codex Two-Account Switcher

Anuraj Singh

|
2 installs
| (0) | Free
Switch between two local Codex logins without handling token refresh.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Codex Account Switcher

Switch between multiple local Codex logins from a VS Code sidebar.

Features

  • Save unlimited Codex accounts.
  • Identify accounts by email, falling back to account ID.
  • Replace saved credentials when saving an already-known account.
  • Switch accounts from the Codex Accounts sidebar.
  • Save the current login before switching.
  • Delete one account or all saved accounts with confirmation.
  • Show only email/account ID in the UI; tokens are never displayed.
  • Use VS Code SecretStorage for saved credentials.

Install locally

  1. Open VS Code.
  2. Press Ctrl+Shift+P.
  3. Run Developer: Install Extension from Location....
  4. Select this folder.
  5. Run Developer: Reload Window.

Open the Codex Accounts icon in the Activity Bar.

Use

Save an account

  1. Sign in to the account using the normal Codex flow.
  2. Open Codex Accounts.
  3. Click Save current account.
  4. Confirm replacement if that account was already saved.

The extension reads the complete current Codex auth.json and stores it for that account. It does not merge individual token fields.

Switch accounts

  1. Open the account selector in the sidebar.
  2. Select a saved account.
  3. Click Apply.
  4. Confirm the switch.
  5. Restart the Codex Extension Host when prompted.

Before switching, the extension saves the current live auth.json to the current account profile. It then writes the selected account profile to the live Codex auth.json. Restarting the Extension Host makes the official Codex extension reread the selected credentials.

Delete accounts

Use the trash icon beside an account to delete one saved profile, or use Delete all saved accounts to remove every saved profile. Both actions require confirmation.

Deleting saved profiles does not delete or change the live Codex auth.json.

Security model

  • Credentials are stored in VS Code SecretStorage, not in this repository.
  • The extension has no telemetry or external service.
  • The extension does not implement token refresh or send tokens to an API.
  • Codex remains responsible for refreshing access and refresh tokens.
  • The extension reads and writes the local Codex authentication file, normally %USERPROFILE%\\.codex\\auth.json, or the path selected by CODEX_HOME.

Only install this extension from a source you trust. Anyone who can run code as your Windows user may be able to access local authentication data.

Package a VSIX

Install the VS Code extension packaging tool:

npm install -g @vscode/vsce

Then package the extension from this folder:

vsce package

VS Code can install the generated .vsix with Extensions: Install from VSIX....

Development

The extension is plain JavaScript and uses the VS Code Extension API. No runtime npm dependencies are required.

The repository is available at:

https://github.com/anuraj27/codex-two-account-switcher

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft