Repository navigation
Description
Description
I work in a single repository but with multiple branches simultaneously. The branches are checked out into different directories (pkb, pkb_develop, pkb_gateway, pkb_checker, etc.).
When opening the pkb_develop directory, OpenCode opened the pkb directory and started making changes there, without any notifications, warnings, or informational windows, and with no way to know that writing was happening to a different directory. I only found out after noticing the data discrepancy.
The same thing happens with the other directories — OpenCode silently redirects everything to the first one.
Plugins
No response
OpenCode version
1.17.7
Steps to reproduce
Steps to Reproduce
-
Prepare the environment:
- Clone a single Git repository into several different directories, for example:
pkb(main branch)pkb_develop(develop branch)pkb_gateway(gateway branch)pkb_checker(checker branch)
- In each directory, switch to its respective branch so that the file states differ across directories.
- Clone a single Git repository into several different directories, for example:
-
Open and use the
pkbdirectory first:- Launch OpenCode and open the
pkbdirectory as the working directory. - Make some changes to files there (this establishes it as the initially opened directory).
- Launch OpenCode and open the
-
Close and try to open a different directory:
- Close the
pkbdirectory (or close OpenCode entirely and relaunch it). - Attempt to open any other directory, for example
pkb_develop.
- Close the
-
Observe which directory is actually opened and where changes land:
- Check which directory OpenCode actually opens – it will be
pkb, notpkb_develop. - Without receiving any notification, make file-modifying operations (edit code, create new files, modify existing ones).
- Check which directory OpenCode actually opens – it will be
-
Verify where changes were written:
- After making changes, check which directory actually received those changes.
Actual Result:
- Once the
pkbdirectory has been opened first, closing it and then trying to open any other directory (e.g.pkb_develop) causes OpenCode to silently open thepkbdirectory again instead of the selected one. - All subsequent file modifications are applied inside
pkb, not in the directory the user intended to work in. - No notifications, warnings, or indicators appear to inform the user that writing is happening in a different directory. The behavior repeats for all other directories: OpenCode always silently redirects to
pkb.
Expected Result:
- OpenCode should open the directory explicitly selected by the user, regardless of previous sessions.
- File changes should be written to the currently opened and actively worked‑in directory.
- Any fallback or redirect to a different directory must be clearly communicated to the user, with a warning and the option to abort.
Screenshot and/or share link
No response
Operating System
Windows 10
Terminal
No response
Activity
github-actions commentedon Jun 18, 2026
This issue might be a duplicate of existing issues. Please check:
These issues all describe the same underlying problem: OpenCode identifies projects by Git remote URL rather than local directory path, causing multiple clones of the same repo to share a project identity and redirect to the first-opened directory.
github-actions commentedon Aug 18, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
Hona commentedon Sep 2, 2026
Fixed for opencode2 launch via #46713
You can try the desktop beta here: https://github.com/anomalyco/opencode-beta