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
[FEATURE]: Each project should have a dedicated /tmp dir #49073
Beyond that, the /tmp/opencode pattern will fail when multiple users use opencode on the same system (/tmp/opencode won't by writable by user B's opencode if it was created by user A's opencode). A simple solution like /tmp/opencode-${UID} would mitigate this. This is what claude does.
We should anyway be using a subdir of $XDG_RUNTIME_DIR on Linux systems. Similar rules should apply to other systems. Putting it in a system-wide folder is naive.
My workaround that I put into a comment elsewhere is an alias in my shell: alias opencode=TMPDIR=${XDG_RUNTIME_DIR} opencode
I suppose you could change that to choose a hashed subfolder of that XDG_RUNTIME_DIR path. Either way, it's sub-optimal that this isn't there already.
Activity
github-actions commentedon Sep 14, 2026
This issue might be a duplicate of existing issues. Please check:
If your request is distinct from those, feel free to clarify the differences so maintainers can better scope this.
mgrachten commentedon Sep 15, 2026
Beyond that, the
/tmp/opencodepattern will fail when multiple users use opencode on the same system (/tmp/opencodewon't by writable by user B's opencode if it was created by user A's opencode). A simple solution like/tmp/opencode-${UID}would mitigate this. This is whatclaudedoes.behrangsa commentedon Sep 15, 2026
Alternatively, instead of a UUID for the project, an idempotent/stable hash might also work.
For example:
/home/behrangsa/Projects/fooecho "/home/behrangsa/Projects/foo" | sha256sum->db823db54587807dc5599efbc293ebffdc08bf43feae923a98d54a9df5274b11/tmp/opencode-db823db54587807dc5599efbc293ebffdc08bf43feae923a98d54a9df5274b11//tmp/opencode-db823db54587807dc5599efbc293ebffdc08bf43feae923a98d54a9df5274b11/{session-id}/zatricky commentedon Sep 26, 2026
We should anyway be using a subdir of
$XDG_RUNTIME_DIRon Linux systems. Similar rules should apply to other systems. Putting it in a system-wide folder is naive.My workaround that I put into a comment elsewhere is an alias in my shell:
alias opencode=TMPDIR=${XDG_RUNTIME_DIR} opencodeI suppose you could change that to choose a hashed subfolder of that XDG_RUNTIME_DIR path. Either way, it's sub-optimal that this isn't there already.