codex-folder-move
Menu-driven migration of OpenAI Codex desktop-app state when project folders move — with verified backups and automatic rollback
A command line tool that safely moves your OpenAI Codex app history and settings when you relocate a project folder on your Mac.
codex-folder-move is a command line tool for people who use the OpenAI Codex desktop app on a Mac. When you move a project folder on your computer, Codex normally loses track of it and treats the moved folder as a brand new project, losing your chat threads, trust settings, and sandbox permissions along the way. This tool fixes that by updating every place Codex stores the old folder path, so your history and settings follow the folder to its new home.
You run it with a single command and it opens a menu driven interface in your terminal. You pick the folder where your projects used to live, pick where they live now, then check off which projects you want to migrate from a list that shows details and warns you about any blockers. After you review a summary of exactly what will change, you type a confirmation word to proceed. The tool works whether you have already moved the folder yourself or not: if it has not been moved yet, the tool copies it for you and verifies the copy file by file, never deleting your original. If it has already been moved, the tool only updates Codex's internal records.
Before changing anything, it backs up every file it is about to touch, with checksums to confirm nothing is corrupted. If any part of the process fails partway through, it automatically restores everything from that backup so you are never left in a broken state. There is also a menu option to manually restore from any past backup, newest first, and it comes with its own standalone rollback script.
The project ships with an automated test suite that builds fake, disposable copies of the Codex data folder to test against, so it never touches your real files during testing, along with a separate smoke test that drives the actual interactive menus inside a real terminal session.
It is a single file with no dependencies beyond Node.js version 18 or newer and the sqlite3 command line tool. It is an independent, unofficial project not affiliated with OpenAI, and it is released under the MIT license.
Where it fits
- Move a Codex project folder to a new location without losing chat history.
- Merge Codex metadata when a folder has already been relocated manually.
- Restore Codex app state from an automatic backup after a failed migration.
- Test folder migrations safely using disposable fixture data.