feat(cli): add /add-dir to track extra directories alongside cwd#155
Merged
emal-avala merged 6 commits intomainfrom Apr 22, 2026
Merged
feat(cli): add /add-dir to track extra directories alongside cwd#155emal-avala merged 6 commits intomainfrom
emal-avala merged 6 commits intomainfrom
Conversation
\`/add-dir <path>\` appends a directory to the session's working set. The system prompt lists tracked extras so the agent knows it's allowed to read and edit files there without re-asking for permission on every cross-directory operation. Forms: /add-dir list tracked extras /add-dir <path> add (path must exist; canonicalized before store) /add-dir --remove <p> remove one /add-dir --clear remove all Not persisted — session-scoped. /context displays the current list.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # crates/cli/src/commands/mod.rs
# Conflicts: # crates/cli/src/commands/mod.rs
# Conflicts: # crates/cli/src/commands/mod.rs # crates/lib/src/state/mod.rs
# Conflicts: # crates/cli/src/commands/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds `/add-dir` — lets the user extend the session's working set beyond `cwd` without restarting. Tracked dirs are surfaced in the system prompt so the agent knows it's allowed to read and edit there without re-asking on every cross-directory operation.
Forms:
Also surfaces the list in `/context`.
Why
Today, when you're working on a mono-repo worktree and want the agent to reference a sibling worktree (or a standalone package outside the repo), you either have to restart in the new dir or hand-wave file paths at the agent. This makes the boundary explicit.
Implementation
Test plan