Allow switching/adding working directories within a Codex CLI session

Resolved 💬 3 comments Opened Mar 9, 2026 by jadchene Closed Apr 2, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI

What feature would you like to see?

Description

Currently in Codex CLI the working directory is fixed after starting a session. If I want to switch to another project directory, I have to exit Codex and start it again, which is inconvenient and breaks the workflow.

It would be very helpful to support commands that allow adding or switching working directories within the current session, similar to:

  • Gemini CLI: /directory add
  • Claude Code: /add-dir

Suggested commands (example)

/directory add <path>
/directory switch <path>
/directory list
/directory remove <path>

or a simpler version:

/add-dir <path>
/switch-dir <path>

Why this helps

  • Avoid restarting Codex just to change directories
  • Better workflow when working across multiple repos or folders
  • Useful for monorepos or when temporarily referencing another project

Currently, having to exit and restart Codex just to change the working
directory is quite cumbersome.

Additional information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 5 months ago

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

  • #12464

Powered by Codex Action

etraut-openai contributor · 5 months ago

Thanks for the feature request.

I think #12464 largely captures this idea. If you think that it's close enough, consider closing this and adding to the other one.

lunaynx · 3 months ago

It looks like this was incorrectly closed as a duplicate of #9386 instead of #12464.