Add ability to update/migrate thread references when projects are moved to new locations
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
- User has projects in
~/Desktop/Projects/ - User creates multiple conversation threads in Codex App for these projects
- User moves the folder to
~/Projects/(using Finder, terminal, etc.) - User opens Codex App to access those threads
- Current behavior: Threads show "This project folder was deleted or moved" and are inaccessible
- 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.
19 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
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.
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.
Very surprised there is no way to do this. would be trivial
desperately need this feature as well
Hitting this issue
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.
Additionally, I found that using the "Hand Off" button to create a worktree for the thread will use a path like
~/.codex/worktrees/6138/yourprojectwithout a chance to give a preferred path. Then if you usegit worktree moveto 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.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.
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
Any updates on this?
@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. 🙌
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.
@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 😁
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...
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...
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.
Fixing this would be especially nice if no one is going to fix #19913
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.