Codex won’t open

Only do this if Codex opens and then closes by itself (this was seen in the VS Code extension). If it opens normally, skip this page. Nothing in the folder below holds course data. It holds Codex’s own history, and you lose only the old chat list, not your sign-in.

This happened on a laptop that had an older version of Codex installed. The older version left a small history database the new one refuses to read. Moving it aside fixes it, and you lose only the old chat list, not your sign-in.

  1. Close every VS Code window and the ChatGPT app.
  2. Open PowerShell (Windows) or Terminal (Mac).
  3. Windows: paste this and press Enter.
cd $env:USERPROFILE\.codex
  1. Paste this:
New-Item -ItemType Directory -Force old-db | Out-Null
  1. Then this:
Move-Item *.sqlite* old-db -Force
  1. Open the app (or VS Code and its Codex panel) again. It builds a fresh database.

On a Mac the folder is .codex in your home folder; move the files ending in .sqlite into a new folder beside them. If it still fails, see the FAQ.

Last checked 2026-11-12.