Config: Add support for --add-dir in config.toml

Resolved 💬 2 comments Opened Feb 20, 2026 by amit-mittal Closed Feb 20, 2026
💡 Likely answer: A maintainer (etraut-openai, 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?

Add a setting to config.toml, so whenever codex is invoked in a directory, it also includes configured directory to which codex (and sandbox) will have access to.

This is useful when CLIs (typically build tools for cache) actually output in a central directory outside the repository root and not everyone in the team might be aware, so we want those changes to persist in config.toml, so it automatically gets applied when someone invoked codex.

Additional information

_No response_

View original on GitHub ↗

2 Comments

etraut-openai contributor · 6 months ago

If I understand correctly, you want something like the sandbox_workspace_write.writable_roots config key but on a per-project basis?

You can do this using layered config files. Create a .codex/config.toml in your project and specify the sandbox_workspace_write.writable_roots config key.

amit-mittal · 6 months ago

You beat me to it. I was just now testing that setting and it is serving my need. 🔥

Curious, if someone runs codex --sandbox_mode=read-only, will it give read access to the directory configured?