Repository navigation
Open
Labels
TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request
Description
Feature Request
Problem
Codex CLI supports --add-dir as a startup flag, but there's no way to add additional working directories during an active session. If you realize mid-conversation that you need the agent to access another directory, you have to quit, restart with the extra --add-dir flag, and lose your session context.
Claude Code solves this with a /add-dir slash command that lets you add directories on the fly without restarting.
Proposed Solution
Add a /add-dir slash command that can be used mid-session to expand the agent's accessible directories.
Example usage (during a session):
> /add-dir ../frontend
Added directory: /Users/me/projects/frontend
> /add-dir ../shared-lib /tmp/fixtures
Added directories:
- /Users/me/projects/shared-lib
- /tmp/fixtures
Use Cases
- Iterative exploration — You start working on one package, then realize you need to check or modify a related directory
- Debugging across boundaries — Mid-investigation, you discover the bug lives in a different repo/directory
- Avoiding session restarts — Preserving conversation context and progress instead of quitting and re-launching with
--add-dir - Dynamic workflows — Projects where the set of relevant directories isn't known upfront
Behavior Details
- Should accept one or more relative or absolute paths
- Validate that each path exists and is a directory
- The agent should immediately be able to read, search, and write in newly added directories
- Could show currently active directories via
/list-dirsor similar - Optionally support
/remove-dirto revoke access
Willingness to Contribute
I'd be happy to work on this and submit a PR if the maintainers are open to it. Would appreciate any pointers on where the slash command system is implemented.
Reacted by Amit Mittal, Hans Christian Diekmann, Lukas, Shoma Okamoto, Huang Zhaobin, Aymvn, Dean Stamler, Jon, abetchi, Rakshit Sinha and 47 more
Reacted by Ignat Remizov
Metadata
Metadata
Assignees
Labels
TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request
Activity
github-actions commentedon Feb 13, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
--add-dirflag to include additional working directories #11746Powered by Codex Action
matthewlloyd commentedon Feb 13, 2026
See also #11612
hcdiekmann commentedon Mar 3, 2026
1+ for this
shmokmt commentedon Mar 4, 2026
+1
aymvngg commentedon Mar 15, 2026
+1
PerkinzPie commentedon Mar 15, 2026
+1 for this request. Would be very useful.
yuriever commentedon Apr 8, 2026
+1 to this
[-]Feature Request: Add `/add-dir` slash command to add directories mid-session[/-][+]Add `/add-dir` slash command to add directories mid-session[/+]xuzijian2019 commentedon May 7, 2026
Any updates on this please? Has it been looked at yet? This is a very neat feature to have.
verticalLine111 commentedon May 28, 2026
+1 for this request. Would be very useful.
javarich commentedon May 29, 2026
+1 for the feature, its very useful in your competitors cli
AmeowCAT commentedon Jul 10, 2026
+1
dmatranga commentedon Jul 25, 2026
Please add this
ghan-1 commentedon Aug 4, 2026
+1, pinky please
leafney commentedon Aug 28, 2026
+1, keenly needed
serans1 commentedon Nov 14, 2026
+1