{"slug": "moving-codex-threads-to-a-new-mac", "title": "Moving Codex Threads to a New Mac", "summary": "An OpenAI partner engineer documented a manual process for migrating OpenAI Codex Desktop state between Macs, preserving active threads, local state, installed skills, plugins, and working context. The key is backing up the ~/.codex directory, excluding a Git fsmonitor socket, and restoring it on the new machine, while ensuring referenced project folders are present. The approach is pragmatic but not a polished migration tool.", "body_md": "As an Open AI Partner and I'm in the middle of switching Macs from M1 Air to M4 Air. What. a. pain. Especially in the enterprise world where you cannot just simply migrate everything from one Mac to another like you can do personally. You need to set it up as new. So here we go...\n\nI didn't want too much ceremony moving my, err, precious, OpenAI Codex Desktop setup from one Mac to another and wanted to preserve my active Codex app threads, local state, installed skills, plugins, and working context. Hey, don't judge me on choice of LLMs, I do use Kiro too tho'!\n\nPolitics aside, the short version: most of what you need lives under `~/.codex`\n\n.\n\nThis is not a polished migration tool. It is a pragmatic backup-and-restore approach that worked for me moving Codex local state between Macs.\n\n(oh, the AI didn't work, but you get the gist 🤣)\n\nThe important Codex state is in:\n\n`~/.codex`\n\nThe useful parts include:\n\n`~/.codex/sessions/`\n\n- conversation rollout files`~/.codex/session_index.jsonl`\n\n- thread index`~/.codex/state_*.sqlite`\n\n- thread metadata and local state`~/.codex/logs_*.sqlite`\n\n- local runtime logs`~/.codex/config.toml`\n\n- Codex configuration`~/.codex/plugins/`\n\n, `~/.codex/skills/`\n\n, `~/.codex/cache/`\n\n- installed plugins, skills, and cached assets`~/.codex/auth.json`\n\n- authentication dataTreat the backup as sensitive because it can include auth tokens and local conversation history.\n\nQuit Codex first, then run this from Terminal on the old, ok, retiring, Mac:\n\n`$ COPYFILE_DISABLE=1 tar --no-xattrs \\`\n\n--exclude='.codex/vendor_imports/skills/.git/fsmonitor--daemon.ipc' \\\n\n-czf ~/Desktop/codex-backup.tgz \\\n\n-C ~ .codex\n\nIf your version of `tar`\n\ndoes not support `--no-xattrs`\n\n, use this:\n\n`$ COPYFILE_DISABLE=1 tar \\`\n\n--exclude='.codex/vendor_imports/skills/.git/fsmonitor--daemon.ipc' \\\n\n-czf ~/Desktop/codex-backup.tgz \\\n\n-C ~ .codex\n\nThe exclude matters because git can leave a filesystem socket at:\n\n`$ ~/.codex/vendor_imports/skills/.git/fsmonitor--daemon.ipc`\n\n`tar`\n\ncannot archive sockets, and you do not need that file on the new machine.\n\nThe `COPYFILE_DISABLE=1`\n\nand `--no-xattrs`\n\nflags avoid macOS extended attribute noise. Those attributes are not important for restoring the Codex thread content.\n\nMove `codex-backup.tgz`\n\nto the new Mac's Desktop.\n\nQuit Codex on the new Mac, then run:\n\n`$ cd ~`\n\n`$ mv ~/.codex ~/.codex.backup.$(date +%Y%m%d-%H%M%S) 2>/dev/null`\n\n`$ COPYFILE_DISABLE=1 tar -xzf ~/Desktop/codex-backup.tgz -C ~`\n\nThen reopen Codex.\n\nYour threads should reappear, including their local metadata and session files.\n\nCodex thread history and project files are separate.\n\nMoving `~/.codex`\n\nrestores the Codex-side state, but it does not move your actual project folders. If a thread points to a workspace path, make sure that folder also exists on the new Mac.\n\nFor example:\n\n`$ mkdir -p ~/Documents/\"Client Pursuit\"`\n\nIf your work lives in OneDrive, let OneDrive fully sync the relevant folders before expecting every file reference to work:\n\n`$ ~/Library/CloudStorage/OneDrive-Slalom/Documents/\"Client Pursuit\"`\n\n-- which might be one of your many (manyⁿ) folders!\n\nAfter reopening Codex:\n\nAfter confirming the transfer worked, delete the archive from both machines:\n\n`$ rm ~/Desktop/codex-backup.tgz`\n\nThe archive contains local Codex state and may include credentials, so do not leave it sitting around.\n\nBack up `~/.codex`\n\n, exclude the Git fsmonitor socket, restore it on the new machine, then make sure the referenced project folders are present.\n\nThat is enough to carry active Codex threads and local context across Macs.", "url": "https://wpnews.pro/news/moving-codex-threads-to-a-new-mac", "canonical_source": "https://dev.to/robcube/moving-codex-threads-to-a-new-mac-2n3i", "published_at": "2026-06-20 01:25:59+00:00", "updated_at": "2026-06-20 01:36:37.880636+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models"], "entities": ["OpenAI", "Codex Desktop", "Mac", "M1 Air", "M4 Air", "Slalom"], "alternates": {"html": "https://wpnews.pro/news/moving-codex-threads-to-a-new-mac", "markdown": "https://wpnews.pro/news/moving-codex-threads-to-a-new-mac.md", "text": "https://wpnews.pro/news/moving-codex-threads-to-a-new-mac.txt", "jsonld": "https://wpnews.pro/news/moving-codex-threads-to-a-new-mac.jsonld"}}