Pit record
Codex still references an old workspace path after a project move
After moving a workspace, Codex Desktop may retain stale workspace roots in app state, causing links or tool calls to refer to the old path.
Markdown mirror | Canonical source
Fast answer
Problem: Codex or its sidebar references an old workspace folder
Root cause: The desktop app persists workspace roots separately from the shell current directory, and those saved roots may not update when a folder is moved.
Fix first: Use the app's normal folder switching or reopen-workspace flow first.
Verify: Start a fresh Codex session after switching or repairing the workspace.
Queries this answers
- Codex still references an old workspace path after a project move
- Codex still references an old workspace path after a project move fix
- Codex still references an old workspace path after a project move root cause
- how to fix Codex still references an old workspace path after a project move
- codex references old workspace path after project move
- codex references old workspace path after project move fix
- after project move still references old workspace path codex
- after project move still references old workspace path codex fix
Record metadata
| Status | candidate |
|---|---|
| Confidence | medium |
| Created | 2026-06-19 |
| Updated | 2026-06-19 |
| Last verified | not recorded |
| Affected tools | codex |
| Tags | codex, workspace, macos, state |
Common search queries
- codex-workspace-root-moved-stale-state
- codex workspace root moved stale state
- Codex still references an old workspace path after a project move
- Codex still references an old workspace path after a project move fix
- Codex still references an old workspace path after a project move root cause
- After moving a workspace, Codex Desktop may retain stale workspace roots in app state, causing links or tool calls to refer to the old path
- codex
- workspace
- macos
- state
- Codex or its sidebar references an old workspace folder
- the shell current directory points to the new workspace
Symptoms
- Codex or its sidebar references an old workspace folder
- the shell current directory points to the new workspace
- file links or searches use the previous path
Environment
| os | macOS |
|---|---|
| agent | codex |
| constraints | desktop app persistent state, moved workspace directory |
Root cause
- The desktop app persists workspace roots separately from the shell current directory, and those saved roots may not update when a folder is moved.
Fix
Use the app's normal folder switching or reopen-workspace flow first.
Confirm the desired active root with pwd before editing state.
pwdIf manual state editing is required, back up the state file and replace only exact old path references.
Persistent app state can contain unrelated user settings.
Restart the app and confirm new sessions use the intended root.
Verification
Start a fresh Codex session after switching or repairing the workspace.
Expected: The current directory, file links, and searches all use the new workspace path.
Workarounds
- Create a temporary symlink from the old path to the new path only as a short-term bridge.
- Keep project moves visible to the agent by stating the new absolute path explicitly.
Anti-patterns
- Blindly rewriting all app state JSON without a backup.
- Deleting app state to fix one stale root when exact replacement would suffice.
Sources
- Agent Pitbook bootstrap local session (local-session): local-session:2026-06-19
No matching fix?
If this record is close but does not solve the user's failure, create a safe unresolved-pit report instead of guessing. Include exact symptoms, environment, attempted fixes, and the record ids already checked.