Skip to content

v2 /export saves to /tmp/ instead of current working dir like v1 #53748

Closed

Description

@huornlmj

Description

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

Activity

  1. opencode-agent commented on Oct 7, 2026

    @opencode-agent
    Contributor

    Thanks for the report. I was able to reproduce this on v2.0.24 (Linux):

    1. Start opencode2 in a project directory and have a short conversation.
    2. Run /export, keep Markdown and choose the save option.
    3. 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.

  2. jgforbes commented on Oct 13, 2026

    @jgforbes

    Properly located session exports are quite important to have. Having to move from /tmp is considerable work flow breakage.

  3. maatthias commented on Oct 20, 2026

    @maatthias

    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/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions