Skip to content

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

Closed

Description

@rockmandash

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

Activity

  1. added
    enhancement
    on Sep 8, 2025
  2. bhack commented on Sep 10, 2025

    @bhack

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

  3. stephent commented on Sep 17, 2025

    @stephent

    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.

  4. rajohns08 commented on Sep 24, 2025

    @rajohns08

    Looks like a duplicate of #2797

  5. francescomugnai commented on Sep 29, 2025

    @francescomugnai

    +1

  6. TanXiang7o commented on Oct 17, 2025

    @TanXiang7o

    +1

  7. added a commit that references this issue on Oct 19, 2025
    4f46360
  8. rubemz commented on Oct 20, 2025

    @rubemz

    +1 looking forward to see it in the next release

  9. added a commit that references this issue on Oct 24, 2025
    f70a2b8
  10. added a commit that references this issue on Nov 10, 2025
    0e3f3ef
  11. added a commit that references this issue on Nov 14, 2025
    d44427e
  12. added a commit that references this issue on Dec 2, 2025
    c00236c
  13. JonasJonny commented on May 27, 2026

    @JonasJonny

    This is working too.

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

    Via #13914 (comment)

  14. alanhe421 commented on Jul 14, 2026

    @alanhe421

    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.

  15. tmccombs commented on Jul 22, 2026

    @tmccombs

    #5335 added support for --add-dir, but afaict there isn't a way to add a directory to an existing session (like /add-dir). Can this be re-opened to account for that? Or shoudl I create a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions