opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[Feature Request] Adding directories / creating workspaces

Open pperanich opened this issue 4 months ago • 17 comments

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?

pperanich avatar Aug 02 '25 14:08 pperanich

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 avatar Aug 04 '25 10:08 Jeune-Tilleul

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

jf-rlgeex avatar Aug 07 '25 14:08 jf-rlgeex

+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 avatar Aug 10 '25 07:08 cvzakharchenko

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

JeongJuhyeon avatar Sep 04 '25 08:09 JeongJuhyeon

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 avatar Sep 04 '25 12:09 rekram1-node

+1 Adding directories would be really valuable!

shaunpatel avatar Sep 09 '25 17:09 shaunpatel

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 avatar Oct 12 '25 15:10 mcdax

acknowledged, and agreed, also no problem @mcdax

rekram1-node avatar Oct 12 '25 16:10 rekram1-node

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

Melodeiro avatar Oct 20 '25 11:10 Melodeiro

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 avatar Oct 22 '25 11:10 JoshuaRileyDev

@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 avatar Oct 22 '25 14:10 rekram1-node

@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 avatar Oct 25 '25 00:10 Melodeiro

wdym by travel with the arrows?

rekram1-node avatar Oct 25 '25 01:10 rekram1-node

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 avatar Oct 26 '25 14:10 Melodeiro

ah i see, yeah we are thinking about it

rekram1-node avatar Oct 26 '25 15:10 rekram1-node

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

hrstoyanov avatar Dec 11 '25 23:12 hrstoyanov

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

junmediatek avatar Dec 18 '25 08:12 junmediatek