Add ability to update/migrate thread references when projects are moved to new locations

Open 💬 21 comments Opened Feb 7, 2026 by becerra-alberto
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

Codex App

What feature would you like to see?

Problem

Currently, when a project folder is moved to a new location, all existing conversation threads associated with that project become inaccessible. The Codex App displays the error message "This project folder was deleted or moved" because the thread references are hardcoded to the original file path.

This is a common workflow - users frequently reorganize their project folders. As noted by the Codex team (issue #11019), threads are stored in an internal database with absolute file path references, making them vulnerable to breakage on relocation.

Proposed Solution

Add a feature that allows users to update or migrate thread references when a project has been moved. Some possible implementations:

Option 1: Automatic Detection & Migration

When opening Codex App, detect if a previously-indexed project has been moved and automatically offer to update the thread references to the new location.

Option 2: Manual Path Update Dialog

Add a "Project Path Changed" dialog that appears when a broken project is accessed, allowing users to:

  • Browse to the project's new location
  • Confirm the update
  • Migrate all associated threads to point to the new path

Option 3: Project Settings UI

Add a new "Update Project Location" option in the project context menu or settings that allows users to manually specify the project's new path and re-establish thread connections.

Benefit

This would prevent users from losing valuable conversation history when they reorganize their projects, which is a natural part of development workflow.

Additional information

Related Issue

This feature request is related to issue #11019, where the Codex team confirmed that threads are associated with the absolute file path of a project. They suggested that "a way to update existing threads to point at a new location after you move your project" would be a good solution.

Use Case Example

  1. User has projects in ~/Desktop/Projects/
  2. User creates multiple conversation threads in Codex App for these projects
  3. User moves the folder to ~/Projects/ (using Finder, terminal, etc.)
  4. User opens Codex App to access those threads
  5. Current behavior: Threads show "This project folder was deleted or moved" and are inaccessible
  6. Desired behavior: Codex detects the issue and helps user recover the threads by updating the project path

This is especially important for users on the free tier who may not have other conversation history preserved.

View original on GitHub ↗

21 Comments

github-actions[bot] contributor · 6 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #11019

Powered by Codex Action

jmsharitt80 · 6 months ago

Just moved my project to a new directory as a result of a Codex recommendation to rename my volume. Would love to see a feature that allowed me to update the Codex thread to point to the new location.

Pabce · 6 months ago

Moving directories around is common during project development, especially during early stages or big refactors. I agree that an option to change the project directory on the Codex app preferences would be very useful.

ryanmish · 6 months ago

Very surprised there is no way to do this. would be trivial

hsw28 · 6 months ago

desperately need this feature as well

jaredar1232 · 5 months ago

Hitting this issue

noshi2x · 5 months ago

Same just encountered this issue. At the moment I just prompted the new path location, my process still works, but the message "Current working directory missing. This thread's working directory no longer exists" is still present.

w00kie · 5 months ago

Additionally, I found that using the "Hand Off" button to create a worktree for the thread will use a path like ~/.codex/worktrees/6138/yourproject without a chance to give a preferred path. Then if you use git worktree move to move it to a nicer path (if I'm going to work for days on a refactor, I want it somewhere nice and visible) codex will not follow the git command and there is no way to tell it to look for the files in the new path.

m-thomson · 4 months ago

What a pathetic joke. If you move your project, all history/context is detached? Really?

The ability to move project folders is a basic-level feature of every code (and non-code) tool on the planet of the past thirty years.

Adam-Bull · 4 months ago

Turns out this can be done pretty easily by an agent with a single prompt. Here is an agent skill I made to get me by until they add this feature to Codex:

https://github.com/Adam-Bull/Codex-thread-toolkit

lgallindo · 4 months ago

Any updates on this?

kylemaclaren · 4 months ago

@Adam-Bull your skill worked great! I submitted a small PR to also re-add the updated chats under the sidebar folders/projects. Without it, existing sidebar folders show as having "no chats" since the project still points to the wrong path. 🙌

PopSplash · 3 months ago

Has anyone tried manually pointing .codex/sessions files to the new folder path? The chat sessions should be portable along with the projects. When I installed Codex I set the default path to my Documents folder, and I wish to change to a more appropriate dev folder outside my windows user folder.

ialexryan · 3 months ago

@Adam-Bull's https://github.com/Adam-Bull/Codex-thread-toolkit worked great for me! I just asked ChatGPT in a new browser window how best to run it, so that I could keep Codex completely quit while I was mucking about with its internals. Or I suppose you could use Claude Code as the doctor 😁

tajemniktv · 3 months ago

I still can't believe it's not a feature. You technically can do it manually (or possibly with a script), but having to fallback to not-native solutions in this era is so off-putting...

ozcanoguz · 3 months ago

Thanks to @Adam-Bull s skill, I also have completed my migration to new folder as my project setup was totally broken due to iCloud sync that I had selected a wrong directory...

Blankdlh · 2 months ago

I ran into a similar local-project move problem and extracted my workaround into a small open-source CLI:

https://github.com/Blankdlh/codex-workspace-migrator

It is not an official Codex fix, but it may be useful as a temporary workaround for people who have already moved or renamed a local Codex project directory.

kevinb9n · 2 months ago

Fixing this would be especially nice if no one is going to fix #19913

pacolaf · 1 month ago

I ran into this on Windows and published a small open-source workaround:

https://github.com/pacolaf/codex-project-path-migrator

It performs a dry-run, validates the current Codex state structure, backs up
the complete .codex directory, migrates structured path references, and rolls
back on failure. It is Windows-only, uses the Python standard library, and is
intended as an unofficial temporary solution until native path remapping is
available.

sunjiajunsunjiajun · 1 month ago

One important case is when a user asks Codex itself to rename or move an already-open project directory. Codex can successfully rename the folder and then strand its own thread history because persisted cwd/project mappings still point at the old absolute path.

This should be one atomic built-in workflow: record the old and new roots, perform the rename, migrate all affected thread cwd/index/sidebar/project mappings and durable rollout metadata, verify that history remains visible, and roll back safely if any step fails. The agent-facing procedure should also ship as a built-in Skill, so Codex automatically follows it whenever it performs a project rename/move rather than requiring users to know about hidden SQLite/JSON state.

As of current main (58b4277228), I still do not see a supported atomic project-root migration/relink flow. thread/settings/update can update a loaded thread for subsequent turns, but it does not migrate every stored thread and Desktop project mapping under an old root.

dingjianhui123-create · 27 days ago

Additional Windows + iOS Remote reproduction (project moved across drives)

I reproduced a related failure on Codex Desktop for Windows where moving a project does not delete the tasks, but breaks the separate task-to-project association used by the sidebar and mobile Remote view.

Environment:

  • Codex Desktop 26.721.11231.0 (x64)
  • Bundled/local codex-cli 0.144.4
  • Windows x64, build 26200.8973
  • ChatGPT iOS app using Codex Remote (exact mobile app version not captured)

Reproduction/state transition:

  1. A Git project named APEX originally lived under C:\Users\<user>\Documents\APEX and had multiple existing tasks.
  2. The project was moved to D:\AI项目\APEX and re-added/saved in Codex Desktop at the new location.
  3. The old tasks remained readable and were not archived or deleted.
  4. The task working directories were updated to the new path, but the tasks did not reappear under the saved APEX project.
  5. Desktop showed APEX with No tasks. The connected iOS Remote view showed only one newer task under APEX, so desktop and mobile presented different project membership for the same host.

Local evidence (identifiers and private paths redacted):

  • state_5.sqlite contained 12 active, unarchived APEX tasks, all readable, with the new cwd.
  • The saved local project existed with root D:\AI项目\APEX and was detected as a Git repository.
  • Listing the 12 tasks returned projectId: null even though their cwd matched the saved project root.
  • The thread-project-assignments global-state map had no entries for those 12 tasks.
  • The tasks were not marked projectless.
  • The persisted saved-workspace roots still included the old C: path.
  • Pinning/unpinning a task did not repair membership.
  • There is no exposed batch relink/migration command; the only immediate UI workaround appears to be manually dragging each task into the new project one by one.

This suggests that project relocation has at least two independent layers: the core task cwd/session state and the Desktop renderer/global thread-project-assignments state. Updating or recovering the cwd alone does not atomically migrate the project membership map, and Remote can then display a different/stale projection.

Expected behavior:

  • When a saved project is relocated, Codex should offer an Update project location / migrate existing tasks operation.
  • That operation should atomically update task cwd, saved workspace roots, task-to-project assignments, and the Remote projection.
  • If automatic matching is unsafe, the UI should provide a batch selector to relink all tasks from an old path to a confirmed new project.
  • Desktop and connected mobile Remote should converge on the same project/task membership without requiring a full restart or manual per-task dragging.

Related symptoms also overlap with #24749 (stale mobile project-thread list) and #25084 (active project history hidden while tasks remain in local storage), but this reproduction is specifically triggered by a project-folder relocation across Windows drives.