Skip to content

EACCES: permission denied, mkdir /.opencode (errno -13) in Plan mode #8389

Closed

Description

@DitherDude

Description

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

  1. Open opencode via opencode (with/-out export OPENCODE_EXPERIMENTAL_PLAN_MODE=1 in ~/.bashrc)
  2. Do anything in buildmode. All OK
  3. Try a prompt in Plan mode. Error above. Agent will not complete task

Screenshot and/or share link

https://github.com/user-attachments/assets/623c060e-bbc0-4190-9e64-e15689a002c5 (video shows with experimental plan mode enabled via ~/.bashrc)

Operating System

Ubuntu 24.04.3 LTS/Linux cascade 6.8.0-90-generic # 91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 14:14:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Terminal

bash via Kitty over ssh (also bash)

Activity

  1. github-actions commented on Jan 14, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. DitherDude commented on Jan 14, 2026

    @DitherDude
    Author

    sudo mkdir /.opencode && sudo chown -R dither:dither /.opencode will fix the issue

  3. DitherDude commented on Jan 14, 2026

    @DitherDude
    Author

    Image I'll assume this is related

  4. added a commit that references this issue on Jan 14, 2026
    f2d8b06
  5. ERJavier commented on Jan 30, 2026

    @ERJavier

    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.

  6. github-actions commented on Apr 1, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions