[Feature Request] Adding directories / creating workspaces #1068

Open
opened 2026-02-16 17:29:21 -05:00 by yindo · 26 comments
Owner

Originally created by @pperanich on GitHub (Aug 2, 2025).

Originally assigned to: @thdxr on GitHub.

One of the features I utilize frequently in Claude Code is adding additional directories to a session that are outside the scope of my working directory. Are there currently plans to implement such a feature or to create a workspace similar to VS code?

Originally created by @pperanich on GitHub (Aug 2, 2025). Originally assigned to: @thdxr on GitHub. One of the features I utilize frequently in Claude Code is adding additional directories to a session that are outside the scope of my working directory. Are there currently plans to implement such a feature or to create a workspace similar to VS code?
Author
Owner

@Jeune-Tilleul commented on GitHub (Aug 4, 2025):

I work always on workspace with several java modules (independant pom.xml and git repository for each) and i manage to open opencode from the main directory and in its AGENTS.md I gave instructions about my workspace structure and to always do "cd [module_dir]" before any bash commande. It manages to do it but sometimes it forgets or target the wrong module. Since v0.3.108 it does not work anymore because of new constraints in bash tool code (exact_path) so i will stay on v0.3.107 until it's resolve or this feature request is implemented;
Loving Opencode by the way ;)

@Jeune-Tilleul commented on GitHub (Aug 4, 2025): I work always on workspace with several java modules (independant pom.xml and git repository for each) and i manage to open opencode from the main directory and in its AGENTS.md I gave instructions about my workspace structure and to always do "cd [module_dir]" before any bash commande. It manages to do it but sometimes it forgets or target the wrong module. Since v0.3.108 it does not work anymore because of new constraints in bash tool code (exact_path) so i will stay on v0.3.107 until it's resolve or this feature request is implemented; Loving Opencode by the way ;)
Author
Owner

@jf-rlgeex commented on GitHub (Aug 7, 2025):

please add this, it's pretty important feature, and one of the few things that have me going back to claude code.

@jf-rlgeex commented on GitHub (Aug 7, 2025): please add this, it's pretty important feature, and one of the few things that have me going back to claude code.
Author
Owner

@cvzakharchenko commented on GitHub (Aug 10, 2025):

+1
Current check for when a command references paths outside the project directory is great. But very annoying if we can't add extra directories.

@cvzakharchenko commented on GitHub (Aug 10, 2025): +1 Current check for when a command references paths outside the project directory is great. But very annoying if we can't add extra directories.
Author
Owner

@JeongJuhyeon commented on GitHub (Sep 4, 2025):

For me too this is the main thing that keeps me going back to Claude Code.

@JeongJuhyeon commented on GitHub (Sep 4, 2025): For me too this is the main thing that keeps me going back to Claude Code.
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

The 0.5 -> 0.6 version bump for opencode built in functionality ro allow for this among other things

NOT currently available through tui but should be easy to add now

@rekram1-node commented on GitHub (Sep 4, 2025): The 0.5 -> 0.6 version bump for opencode built in functionality ro allow for this among other things NOT currently available through tui but should be easy to add now
Author
Owner

@shaunpatel commented on GitHub (Sep 9, 2025):

+1 Adding directories would be really valuable!

@shaunpatel commented on GitHub (Sep 9, 2025): +1 Adding directories would be really valuable!
Author
Owner

@mcdax commented on GitHub (Oct 12, 2025):

Sorry for bringing this up again - I don't mean to spam the issue, but I wanted to emphasize how much this missing feature impacts daily workflow.

Currently, I have to rely on symlinks to get access to other / related projects.

@mcdax commented on GitHub (Oct 12, 2025): Sorry for bringing this up again - I don't mean to spam the issue, but I wanted to emphasize how much this missing feature impacts daily workflow. Currently, I have to rely on symlinks to get access to other / related projects.
Author
Owner

@rekram1-node commented on GitHub (Oct 12, 2025):

acknowledged, and agreed, also no problem @mcdax

@rekram1-node commented on GitHub (Oct 12, 2025): acknowledged, and agreed, also no problem @mcdax
Author
Owner

@Melodeiro commented on GitHub (Oct 20, 2025):

You can use bash to bypass it (not everything works tho, well, excess security motivated to use it even less securely xD

@Melodeiro commented on GitHub (Oct 20, 2025): You can use bash to bypass it (not everything works tho, well, excess security motivated to use it even less securely xD
Author
Owner

@JoshuaRileyDev commented on GitHub (Oct 22, 2025):

Please implement this as it's been a nightmare me trying to work with this issue over the last few days, even going as far as having it read images, it can't do that now

@JoshuaRileyDev commented on GitHub (Oct 22, 2025): Please implement this as it's been a nightmare me trying to work with this issue over the last few days, even going as far as having it read images, it can't do that now
Author
Owner

@rekram1-node commented on GitHub (Oct 22, 2025):

@JoshuaRileyDev reading images should work, what model + provider are you using?

Also we will add this soon, we are currently rewriting tui and shipping it this week, but this is one of the features that we want + need so I hope we can add it shortly after.

I think the main question was what does the UX look like to add another dir, because the way claude code does it is kinda meh, I think codex does it by just requiring permission which is decent but it doesnt add a dir in the sense that you can use "@" to get files from that other dir, etc

I guess if anyone has opinions or ideas on ux feel free to drop them

@rekram1-node commented on GitHub (Oct 22, 2025): @JoshuaRileyDev reading images should work, what model + provider are you using? Also we will add this soon, we are currently rewriting tui and shipping it this week, but this is one of the features that we want + need so I hope we can add it shortly after. I think the main question was what does the UX look like to add another dir, because the way claude code does it is kinda meh, I think codex does it by just requiring permission which is decent but it doesnt add a dir in the sense that you can use "@" to get files from that other dir, etc I guess if anyone has opinions or ideas on ux feel free to drop them
Author
Owner

@Melodeiro commented on GitHub (Oct 24, 2025):

@rekram1-node
What do you think about going the claude code way, but allowing to travel the directory path with the keyboard arrows? If we are talking about TUI

@Melodeiro commented on GitHub (Oct 24, 2025): @rekram1-node What do you think about going the claude code way, but allowing to travel the directory path with the keyboard arrows? If we are talking about TUI
Author
Owner

@rekram1-node commented on GitHub (Oct 24, 2025):

wdym by travel with the arrows?

@rekram1-node commented on GitHub (Oct 24, 2025): wdym by travel with the arrows?
Author
Owner

@Melodeiro commented on GitHub (Oct 26, 2025):

I mean, Claude Code gives you not very optimal path to include in auto-accept rule. By allowing to travel the path (i mean its depth), you can configure if you want broader rule. F.e.:
Agent proposal:
/home/user/apps/app1/logs
Aflter pressing left arrow on keyboard, it changes to:
/home/user/apps/app1 pressing againg changes to /home/user/apps/, etc
Then you can accept this new rule and continue to use the agent

╭───────────────────────────────────────────────────────────────────────────────
│ Bash command                                                                  
│                                                                               
│   rm -rf /home/user/.prompts                                            
│   Remove .prompts directory                                                   
│                                                                               
│ Do you want to proceed?                                                       
│   1. Yes                                                                      
│ ❯ 2. Yes, and don't ask again for rm commands in /home/user    <---   **Talking about this path**
│   3. No, and tell Claude what to do differently (esc)                         
╰───────────────────────────────────────────────────────────────────────────────
@Melodeiro commented on GitHub (Oct 26, 2025): I mean, Claude Code gives you not very optimal path to include in auto-accept rule. By allowing to travel the path (i mean its depth), you can configure if you want broader rule. F.e.: Agent proposal: `/home/user/apps/app1/logs` Aflter pressing left arrow on keyboard, it changes to: `/home/user/apps/app1` pressing againg changes to `/home/user/apps/`, etc Then you can accept this new rule and continue to use the agent ``` ╭─────────────────────────────────────────────────────────────────────────────── │ Bash command │ │ rm -rf /home/user/.prompts │ Remove .prompts directory │ │ Do you want to proceed? │ 1. Yes │ ❯ 2. Yes, and don't ask again for rm commands in /home/user <--- **Talking about this path** │ 3. No, and tell Claude what to do differently (esc) ╰─────────────────────────────────────────────────────────────────────────────── ```
Author
Owner

@rekram1-node commented on GitHub (Oct 26, 2025):

ah i see, yeah we are thinking about it

@rekram1-node commented on GitHub (Oct 26, 2025): ah i see, yeah we are thinking about it
Author
Owner

@hrstoyanov commented on GitHub (Dec 11, 2025):

Gemini and Qwen cli both support multiple directories. If opencode works from a single root directory only, that is so sad

@hrstoyanov commented on GitHub (Dec 11, 2025): Gemini and Qwen cli both support multiple directories. If opencode works from a single root directory only, that is so sad
Author
Owner

@junmediatek commented on GitHub (Dec 18, 2025):

hi @thdxr & @rekram1-node
Could you share the estimated completion time for this feature?

@junmediatek commented on GitHub (Dec 18, 2025): hi @thdxr & @rekram1-node Could you share the estimated completion time for this feature?
Author
Owner

@Y-ASLant commented on GitHub (Jan 24, 2026):

该功能还会继续推进吗?

@Y-ASLant commented on GitHub (Jan 24, 2026): 该功能还会继续推进吗?
Author
Owner

@ckarsan commented on GitHub (Jan 26, 2026):

Hi it's not clear if this added as of yet, i wasn't sure how to add 2 workspaces / project folders (client and server) to opencode.

@ckarsan commented on GitHub (Jan 26, 2026): Hi it's not clear if this added as of yet, i wasn't sure how to add 2 workspaces / project folders (client and server) to opencode.
Author
Owner

@YPares commented on GitHub (Feb 2, 2026):

So you can add external_directory via json config file (https://opencode.ai/docs/permissions/#external-directories) but I agree that being able to add this while the session via a Add external directory command would be very convenient.

@YPares commented on GitHub (Feb 2, 2026): So you can add `external_directory` via json config file (https://opencode.ai/docs/permissions/#external-directories) but I agree that being able to add this while the session via a `Add external directory` command would be very convenient.
Author
Owner

@JagoWang commented on GitHub (Feb 4, 2026):

Is there any plan for this feature currently?

@JagoWang commented on GitHub (Feb 4, 2026): Is there any plan for this feature currently?
Author
Owner

@MordechaiHadad commented on GitHub (Feb 8, 2026):

Yes it would be great to add external files for etc context like spec files and such

@MordechaiHadad commented on GitHub (Feb 8, 2026): Yes it would be great to add external files for etc context like spec files and such
Author
Owner

@noxware commented on GitHub (Feb 9, 2026):

Fun/lazy solution for the moment, ask the AI to do the symlink for you:

Hey! Can you make a symlink to /path/to/other/project into the symlinks directory and add symlinks to .gitignore? Thank you!

@noxware commented on GitHub (Feb 9, 2026): Fun/lazy solution for the moment, ask the AI to do the symlink for you: > Hey! Can you make a symlink to `/path/to/other/project` into the `symlinks` directory and add `symlinks` to `.gitignore`? Thank you!
Author
Owner

@noxware commented on GitHub (Feb 10, 2026):

No, @ doesn't work for me. It ignores the symlinks directory. I tried removing it from .gitignore and make a new session but nothing. Is @ broken across symlinks? Maybe related to this recent comment in a closed issue: https://github.com/anomalyco/opencode/issues/747#issuecomment-3860005494

@noxware commented on GitHub (Feb 10, 2026): No, `@` doesn't work for me. It ignores the `symlinks` directory. I tried removing it from `.gitignore` and make a new session but nothing. Is `@` broken across symlinks? Maybe related to this recent comment in a closed issue: https://github.com/anomalyco/opencode/issues/747#issuecomment-3860005494
Author
Owner

@nodeselector commented on GitHub (Feb 11, 2026):

table stakes

@nodeselector commented on GitHub (Feb 11, 2026): table stakes
Author
Owner

@honeymath commented on GitHub (Feb 15, 2026):

If I use my opencode setup in the same directory and open five sessions, I need each session to start with different settings due to distinct requirements and to isolate their skills from one another. Symlinks do not work. Modifying the JSON file does not work. Even if a workaround temporarily functions, it requires manual cleanup after the session ends. The only reliable solution is to allow sessions to be launched with the --add-dir command. PLEASE ADD THIS FEATURE.

@honeymath commented on GitHub (Feb 15, 2026): If I use my opencode setup in the same directory and open five sessions, I need each session to start with different settings due to distinct requirements and to isolate their skills from one another. Symlinks do not work. Modifying the JSON file does not work. Even if a workaround temporarily functions, it requires manual cleanup after the session ends. The only reliable solution is to allow sessions to be launched with the --add-dir command. PLEASE ADD THIS FEATURE.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1068