You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Add --add-dir flag to include additional working directories #11746
When working on projects that span multiple directories (monorepos, separate frontend/backend repos, shared libraries), Codex CLI is limited to the current working directory. There's no way to give the agent access to additional directories without changing your working directory or running separate sessions.
Proposed Solution
Add an --add-dir flag (similar to what Claude Code offers) that allows users to specify additional directories the agent should have access to during a session.
Example usage:
# Working on an API, but need access to the frontend and shared libscd my-project/packages/api
codex --add-dir ../web ../shared
This would give Codex access to:
my-project/packages/api (current working directory)
my-project/packages/web (via --add-dir)
my-project/packages/shared (via --add-dir)
Use Cases
Monorepos / multi-package projects — Working on a feature that touches multiple packages
Separate frontend + backend repos — Need the agent to understand the API contract while working on the backend (or vice versa)
Shared libraries — Modifying a shared library alongside the projects consuming it
Cross-project refactoring — Coordinated changes across multiple directories
Behavior Details
Paths can be relative or absolute
Each path should be validated to exist as a directory at startup
The agent should be able to read, search, and (optionally) write to all added directories
Could also support an in-session command like /add-dir <path> for adding directories mid-conversation
Willingness to Contribute
I'd be happy to work on this and submit a PR if the maintainers are open to it. Would love guidance on the preferred implementation approach.
Activity
Deveshb15 commentedon Feb 13, 2026
Closing — this was filed incorrectly. The
--add-dirCLI flag already exists. Re-filing as a request for an in-session/add-dirslash command instead.peterbecich commentedon May 13, 2026
Related to the
--add-dirCLI flag:The CLI flag may already exist, but I do not see the second
dirincluded here: