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
v2 /export saves to /tmp/ instead of current working dir like v1 #53748
As subject states, when I export in v 1.18, the md file is saved into the current working directory. In v2, it's saved into /tmp. I don't want this, I want it to save in the current working directory. Not to mention /tmp/ on a linux system is open to all local users, which is a severe negative security misstep.
Plugins
None
OpenCode version
2.0.24
Steps to reproduce
Do the above.
Screenshot and/or share link
No response
Operating System
Linux
Terminal
putty
Reacted by Chris Kuethe, Matt Snyder and Philip Chimento
Thanks for the report. I was able to reproduce this on v2.0.24 (Linux):
Start opencode2 in a project directory and have a short conversation.
Run /export, keep Markdown and choose the save option.
The "Session exported" dialog shows a path like /tmp/session-<uuid>.md. Nothing is written to the working directory.
With the default umask (0022), the exported file is created as -rw-r--r--, so other local users can read the transcript, as you pointed out. In v2 the save path comes from the system temp directory and no file mode is set. I've passed this on to the maintainers.
I too prefer the v1 behavior of session transcript exporting to current working directory and 👍 this. Note that the above is not correct about where the opencode v2 TUI exports to. While the TUI reports /tmp/session-{uuid} this is just its sandboxed view. To get the export on disk:
# get the opencode pid
pgrep opencode
ls -al /proc/{pid}/root/tmp/
Activity
opencode-agent commentedon Oct 7, 2026
Thanks for the report. I was able to reproduce this on v2.0.24 (Linux):
opencode2in a project directory and have a short conversation./export, keep Markdown and choose the save option./tmp/session-<uuid>.md. Nothing is written to the working directory.With the default umask (0022), the exported file is created as
-rw-r--r--, so other local users can read the transcript, as you pointed out. In v2 the save path comes from the system temp directory and no file mode is set. I've passed this on to the maintainers.jgforbes commentedon Oct 13, 2026
Properly located session exports are quite important to have. Having to move from /tmp is considerable work flow breakage.
maatthias commentedon Oct 20, 2026
I too prefer the v1 behavior of session transcript exporting to current working directory and 👍 this. Note that the above is not correct about where the opencode v2 TUI exports to. While the TUI reports
/tmp/session-{uuid}this is just its sandboxed view. To get the export on disk:# get the opencode pid pgrep opencode ls -al /proc/{pid}/root/tmp/