Feature Request: Add `--add-dir` flag to include additional working directories

Resolved 💬 2 comments Opened Feb 13, 2026 by Deveshb15 Closed Feb 13, 2026

Feature Request

Problem

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 libs
cd 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

  1. Monorepos / multi-package projects — Working on a feature that touches multiple packages
  2. Separate frontend + backend repos — Need the agent to understand the API contract while working on the backend (or vice versa)
  3. Shared libraries — Modifying a shared library alongside the projects consuming it
  4. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗