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
EACCES: permission denied, mkdir /.opencode (errno -13) in Plan mode #8389
Occurs only in planmode, whether using the experimental feature flag (as shown in the X post) or not.
EACCES: permission denied, mkdir `/.opencode`
path: "/.opencode",
scall: "mkdir",
errno: -13,
c{this part is cut off by the text "Plan {model} {provider}
Between you and me, I would really prefer if there wasn't an .opencode directory at the root of my OS
opencode called in /home/dither/{project} via opencode (do I need to opencode .?)
Plugins
None/Vanilla
OpenCode version
1.1.19 (released 5hrs ago)
Steps to reproduce
Open opencode via opencode (with/-out export OPENCODE_EXPERIMENTAL_PLAN_MODE=1 in ~/.bashrc)
Do anything in buildmode. All OK
Try a prompt in Plan mode. Error above. Agent will not complete task
Just ran into this on my Mac (M1/Bun v1.3.5) and managed to get it working.
The issue is that the installer (or a previous run) created the ~/.local/state folder with restricted permissions (owned by root), so OpenCode crashes because it can't create its own subfolders there.
If you're stuck with the EACCES error, just run this to take back control of the folder:
sudo chown -R $(whoami) ~/.local/state
Worked like a charm for me after that! It might be worth checking if the install script can handle these permission checks automatically so others don't have to DIY a fix.
Reacted by Jason Zvaniga, Nick Strijbos, Imri Paran, Joao Victor Zanatta and Heng Ji
Activity
github-actions commentedon Jan 14, 2026
This issue might be a duplicate of existing issues. Please check:
.envin project root #8225: OpenCode crashes when no permissions to read.envin project root - Related permission denied errors affecting initializationFeel free to ignore if none of these address your specific case.
DitherDude commentedon Jan 14, 2026
sudo mkdir /.opencode && sudo chown -R dither:dither /.opencodewill fix the issueDitherDude commentedon Jan 14, 2026
fix(session): use directory instead of root for plan mode paths
ERJavier commentedon Jan 30, 2026
Just ran into this on my Mac (M1/Bun v1.3.5) and managed to get it working.
The issue is that the installer (or a previous run) created the ~/.local/state folder with restricted permissions (owned by root), so OpenCode crashes because it can't create its own subfolders there.
If you're stuck with the EACCES error, just run this to take back control of the folder:
sudo chown -R $(whoami) ~/.local/stateWorked like a charm for me after that! It might be worth checking if the install script can handle these permission checks automatically so others don't have to DIY a fix.
github-actions commentedon Apr 1, 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.