Skip to content

All my projects and conversations are missing after Computer restart #19615

Open

Description

@novaflash82

What version of the Codex App are you using (From “About Codex” dialog)?

26.422.30944

What subscription do you have?

Pro

What platform is your computer?

Windows 11 Home

What issue are you seeing?

My Computer had to restart and when it loaded back up I started Codex back up and when I did all of my projects and chats in codex are gone. If I search for them, they do show up, but I can't see them on the main interface. New chats won't appear either.

So no matter what I do I can't see new chats or projects or conversations.

What steps can reproduce the bug?

Uploaded thread: 56c49608-2ed1-4765-8258-91fc3ac3ae97

No clue. My computer shut down and when it came back on all my projects and conversations in Codex were missing. I've tried rebooting and nothing.

What is the expected behavior?

Normally all of my chats and projects are in Codex. New chats show up too. Nothing does now.

Additional information

No response

Activity

  1. added
    appIssues related to the Codex desktop app
    on Apr 26, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Apr 26, 2026
  3. Deadlywolf712 commented on Apr 26, 2026

    @Deadlywolf712

    I'm getting this problem too, its extremely frustrating.

  4. novaflash82 commented on Apr 26, 2026

    @novaflash82
    Author

    I was able to recover from this locally and wanted to add the concrete workaround/root cause I found.

    BTW, Codex with 5.5 on extra high FIXED THIS PROBLEM. So it literally fixed itself lol

    This did not appear to be data loss. The threads still existed in the local Codex database (%USERPROFILE%\.codex\state_5.sqlite) and session files. The missing sidebar/projects were caused by the desktop app's global UI/project state being rewritten without saved workspace roots.

    On the affected Windows machine, %USERPROFILE%\.codex\.codex-global-state.json had been reduced to only the current projectless thread state, for example it was missing keys like:

    • electron-saved-workspace-roots
    • active-workspace-roots
    • most entries under thread-workspace-root-hints

    Older temp global-state files under %USERPROFILE%\.codex\ still contained the prior workspace root, and state_5.sqlite still contained the older thread rows. Restoring those keys brought the sidebar/projects back.

    Important detail: editing .codex-global-state.json while Codex Desktop was still running did not stick. The running app had the empty sidebar/project state in memory and overwrote the restored file again on shutdown/relaunch.

    The recovery that worked was:

    1. Back up %USERPROFILE%\.codex\.codex-global-state.json and %USERPROFILE%\.codex\state_5.sqlite.
    2. Fully quit Codex Desktop, including all background Codex.exe / codex.exe processes. Closing the window was not enough in this case.
    3. While Codex was fully stopped, restore the missing global state keys:
      • electron-saved-workspace-roots: array of the local workspace root(s)
      • active-workspace-roots: same workspace root(s)
      • thread-workspace-root-hints: map existing thread IDs from state_5.sqlite back to their workspace roots
    4. Relaunch Codex Desktop.

    After doing the restore post-exit, the projects and conversations reappeared in the left sidebar.

    Suggested product-side fixes:

    • Treat missing/empty electron-saved-workspace-roots / active-workspace-roots as recoverable if state_5.sqlite still has local threads with cwd values.
    • On startup, rebuild workspace roots and thread-workspace-root-hints from the local thread DB/session index when the global state file is missing, truncated, or inconsistent.
    • Avoid overwriting a repaired .codex-global-state.json from stale in-memory empty state during shutdown.
    • Consider preserving the last known good global-state file before writing a reset/empty one.

    This looks like a sidebar/project index corruption issue, not deletion of conversations.

  5. osvince commented on Jun 8, 2026

    @osvince

    This happened to me and I realized what happened. Very simple fix in my case. I had defined CODE_HOME in the environment variables to point to a new folder, but unknown to me the change wasn't picked up right away. I may or may not have opened Codex one before making the change, but I had not restarted my computer. So Codex saved all of its data into the default location, then switched to the one I had set after my computer restarted.

    After I deleted CODEX_HOME and rebooted again, all of my chats/data was back.

  6. john23m6 commented on Aug 5, 2026

    @john23m6

    I am experiencing the same or a closely related issue on Codex Desktop for Windows.

    During the last week of July 2026, multiple previously visible and pinned Codex projects and their project history suddenly disappeared from the interface.

    I did not intentionally delete, archive, unpin, or move these projects to another account or workspace.

    The missing projects contained ongoing development work, project instructions, implementation history, technical decisions, previous task context, and completed Codex work. Their disappearance forced me to reconstruct project context and repeat previously completed Codex tasks.

    I submitted diagnostic feedback through the Codex Desktop app.

    Feedback ID:

    019fb27c-bcc3-7243-970b-7655ccad1da4

    Please associate the diagnostic data attached to this Feedback ID with this issue and investigate:

    1. Whether any user-initiated deletion, archive, unpin, or workspace transfer event exists.
    2. Whether the missing projects and sessions still exist in local or server-side records.
    3. Whether the project/sidebar index or project-to-session associations can be restored.
    4. Whether this issue resulted from synchronization, indexing, migration, or a Windows desktop client problem.
    5. Whether similar incidents occurred during the same period.

    The disappearance caused me to repeat previously completed work and consume additional Codex usage, credits, tokens, and plan limits. I will submit the account-specific usage compensation request privately through OpenAI Support.

    I am not posting my account email, private project names, repository details, or other confidential account information publicly.

  7. ilyafefelov commented on Sep 2, 2026

    @ilyafefelov

    Confirmed another Windows variant and recovered it durably on Codex Desktop 26.831.2377.0.

    This was not conversation data loss. The local DB still contained 186 thread rows, but the project registry had been wiped:

    • state_5.sqlite: projects=0, project_roots=0, project_idempotency_keys=0
    • .codex-global-state.json: only one surviving entry under local-projects / project-order
    • Older local DB backup: all 8 projects and roots were still present

    Restarting, signing out/in, and clearing app caches did not help because the persistent project registry itself was incomplete.

    The recovery that worked was:

    1. Back up %USERPROFILE%\.codex\state_5.sqlite (including WAL/SHM if present) and .codex-global-state.json.
    2. Fully stop all Codex/ChatGPT background processes. The running app can overwrite repaired state from memory.
    3. Restore the known-good rows for projects, project_roots, and project_idempotency_keys into the current state_5.sqlite in one transaction.
    4. Reassign threads.project_id by normalized longest-prefix matching of threads.cwd to project_roots.path.
    5. Rebuild these global-state sections consistently from the same recovered projects:
      • local-projects
      • project-order
      • app-server-project-id-by-legacy-project-id-by-host
      • app-server-projects-migration-by-host
      • thread-project-assignments
    6. Restart Desktop.

    After restart, all 8 projects returned both in the left sidebar and in the project selector for a new task. Existing project conversations remained attached.

    Important: this is schema-sensitive and should not be applied blindly. Use a known-good backup, validate with PRAGMA integrity_check, preserve IDs, and verify counts before replacing the global-state file. If no backup exists, project roots can potentially be reconstructed from distinct threads.cwd values, but project IDs and legacy/app-server mappings must still be generated consistently.

    This suggests Desktop needs an official startup repair path that detects threads > 0 together with an empty/incomplete project registry and rebuilds projects/associations from durable thread cwd data instead of presenting apparent data loss.

  8. Zoinen commented on Sep 7, 2026

    @Zoinen

    was getting this a few times in the past, and today again, it's not fixed

  9. Zoinen commented on Sep 7, 2026

    @Zoinen

    thanks Claude Code, it fixed my Codex:

    Desktop app wiped local-projects and overwrote its own backup with the empty state

    Platform: Windows 11, Codex desktop (MSIX: OpenAI.Codex_2p2nqsd0c76g0)

    What happened:
    All 5 of my projects disappeared from the sidebar. Chats were unaffected.

    Root cause (from disk inspection):
    Projects are stored in two places:

    • ~/.codex/state_5.sqlite (projects, project_roots) -> still intact, 5 rows / 11 roots
    • ~/.codex/.codex-global-state.json, key "local-projects" -> reset to {}
      Only the JSON key was cleared, but that's what the UI reads, so the sidebar
      went empty even though the DB was fine.

    The serious part: in the same write, .codex-global-state.json.bak was
    overwritten with the already-empty state. So the app destroyed its own
    backup. The only surviving copy was a stale
    "..codex-global-state.json.tmp--" leftover from a previous
    write. Without that orphaned temp file this would have been unrecoverable.

    Suggested fixes:

    1. Don't refresh .bak from a state that just lost a populated key —
      validate before overwriting the backup.
    2. Have the UI fall back to the sqlite projects table when local-projects
      is empty, since the data is right there.

    Recovery I used:
    Restored the "local-projects" object from the newest non-empty .tmp-
    snapshot back into .codex-global-state.json (app closed). Safe against
    duplicates because project_idempotency_keys already maps each legacy JSON
    project id to its sqlite project id, so reconciliation matches instead of
    re-creating.

    Related, possibly same migration: app-server-projects-migration-by-host
    shows "threadAssignmentsMigrated": false, and threads.project_id is NULL
    for all 715 threads. Projects came back empty because chat->project
    assignments never migrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions