You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode web - thinks it is in root (/) path #6336
I have the issue that while opencode recognises the folder that we run (eg we run opencode from folder /opt/myproject) , the web version thinks it is run from root. This behavior exists in all opencode versions -from 1.0.185+
To work in a project from webUi I must always issue the command to opencode (web) chat change to folder /opt/myproject.
Note (this might help): I noticed that when I open opencode web from the terminal ,sometimes for about a split second, it shows the correct folder but it instantly changes to "/".
This issue might be a duplicate of existing issues. Please check:
Cannot ’open project‘ in Web mode #6307: Cannot 'open project' in Web mode - appears to be related to the same working directory/project path issue in web mode
Feel free to ignore if none of these address your specific case.
Some extra information that might or might not help... Results for /init command :
-If I run the terminal version of opencode in /opt/myproject then it creates the file /opt/myproject/AGENTS.md normally.
-If I run /init from the webUI (even after I do a cd /opt/myproject/ ) the AGENTS.md is created on root /AGENTS.md (which could be DANGEROUS)
Just another observation. When I have both TUI and WebUI open they are syncronised (in WebUI I see what is happening to TUI . But, webUi still think he is in root folder (=if I enter a command in TUI and WebUI it will be applied to different folders)
Just adding my 2 cents here after experiencing this issue this morning as well while prototyping something: I noticed that if you ping the server using curl, it does appear to know what folder it's in even when the web ui still thinks it's in the home folder.
In my case, /root/project is where I'm trying to start Opencode; directory appears to hold the correct location. Given that directory is pointing to the correct starting location hopefully it's a simple fix since the data is already there.
Same issue on linux with v1.2.1
Just installed opencode with curl command. Went to my project directory, and ran "opencode web". In the browsers, it shows the root folder.
Activity
github-actions commentedon Dec 29, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
plirof commentedon Dec 29, 2025
Some extra information that might or might not help...
Results for /init command :
-If I run the terminal version of opencode in /opt/myproject then it creates the file /opt/myproject/AGENTS.md normally.
-If I run /init from the webUI (even after I do a cd /opt/myproject/ ) the AGENTS.md is created on root /AGENTS.md (which could be DANGEROUS)
plirof commentedon Jan 2, 2026
Just another observation. When I have both TUI and WebUI open they are syncronised (in WebUI I see what is happening to TUI . But, webUi still think he is in root folder (=if I enter a command in TUI and WebUI it will be applied to different folders)
Fun10165 commentedon Jan 7, 2026
I encounter the same issue on macOS (M4).
sortofsleepy commentedon Jan 19, 2026
Just adding my 2 cents here after experiencing this issue this morning as well while prototyping something: I noticed that if you ping the server using curl, it does appear to know what folder it's in even when the web ui still thinks it's in the home folder.
In my case,
/root/projectis where I'm trying to start Opencode;directoryappears to hold the correct location. Given thatdirectoryis pointing to the correct starting location hopefully it's a simple fix since the data is already there.foertel commentedon Feb 8, 2026
still broken in v1.1.53 on linux
McKlinton2 commentedon Feb 14, 2026
Same issue on linux with v1.2.1
Just installed opencode with curl command. Went to my project directory, and ran "opencode web". In the browsers, it shows the root folder.
tacman commentedon Feb 14, 2026
My workaround is to do a git init in that directory and restart opencode on a different port. Then it seems to work.
github-actions commentedon Apr 16, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.