Add support for `/add-dir` (let Codex see multiple projects, not just one folder)

Resolved 💬 8 comments Opened Sep 8, 2025 by rockmandash Closed Oct 19, 2025

What feature would you like to see?

Right now Codex feels kinda nearsighted 👓 — it only looks at the folder where I launched it.
But in real life, projects aren’t that clean. I’ve got a frontend repo talking to a backend repo, plus a shared/ folder with types, plus an infra repo with scripts… you get the idea.

Today, my “workflow” is basically:

  • copy stuff manually across repos
  • or start another Codex session and lose context
  • or do symlink shenanigans that make me feel like a hacker from the 90s

Meanwhile, Claude Code already has this cute trick: --add-dir (at startup) and /add-dir (mid-session). You just point it at another repo, and boom, it can see it. Super handy when you’re juggling FE/BE or polyrepos.

I’d love Codex to get the same superpower:

  • codex --add-dir ../backend ../shared at launch
  • /add-dir ../infra while chatting
  • maybe even /remove-dir when you realize you went too far 🗑️

Are you interested in implementing this feature?

I don’t mind testing or writing up real-world examples, but I’ll leave the actual code to you folks.

Additional information

_No response_

View original on GitHub ↗

8 Comments

bhack · 10 months ago

I think this also requires in the extension and add files/folders button in the chat with a file/folder picker.

stephent · 10 months ago

Would love to see this - it's a very common scenario when using agents to help port from one language to another (or one framework to another etc. etc.). Right now, Codex is a bit hamstrung compared to CC for these scenarios.

rajohns08 · 9 months ago
francescomugnai · 9 months ago

+1

TanXiang7o · 9 months ago

+1

rubemz · 9 months ago

+1 looking forward to see it in the next release

JonasJonny · 1 month ago

This is working too.

// config.toml
[sandbox_workspace_write]
writable_roots = ["/Users/xxxxx/Dir_1", "/Users/xxxxx/Dir_2"]

Via https://github.com/openai/codex/issues/13914#issuecomment-4017650273

alanhe421 · 6 days ago
This is working too. `` // config.toml [sandbox_workspace_write] writable_roots = ["/Users/xxxxx/Dir_1", "/Users/xxxxx/Dir_2"] `` Via #13914 (comment)

For now, this is the only solution available. Still, looking forward to better support for slash commands.