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
opencode -s resumes sessions from the launch directory instead of the stored session directory #28581
Running opencode -s <session-id> should resume the session in that session's stored working directory. Today, local resume can keep using the directory where the command was launched instead.
That makes the resumed session look correct in history, but the active execution context can be wrong:
prompts report the launch directory rather than the session directory
relative file paths resolve from the launch directory
tools and shell commands run against the wrong project
TUI resume starts the worker with the launch/project directory even when the session was created elsewhere
This is easy to hit when resuming a known session from a different terminal directory, or when continuing sessions across worktrees/subdirectories.
Plugins
None required.
OpenCode version
Current dev.
Steps to reproduce
Create a session in directory A.
From directory B, run opencode -s <session-id-from-A>.
Ask opencode for the current working directory or run a relative file/tool operation.
Expected: the resumed session uses directory A, the stored session.directory.
Actual: the resumed session can continue using directory B, the launch directory.
Screenshot and/or share link
No response
Operating System
macOS, but this is CLI/session directory handling and should not be OS-specific.
This issue might be a duplicate of existing issues. Please check:
[BUG]: Session switching doesn't change working directory context #6697: [BUG]: Session switching doesn't change working directory context — describes the same root cause: when resuming/switching sessions, the execution context remains bound to the launch directory (Instance.directory) rather than the session's stored directory. That issue was closed but the behaviour you describe appears to still be present.
At present, it seems that this issue has been "resolved" in a certain sense. If you resume through a different path, the conversation cannot continue, and the interface will freeze (though the conversation itself continues). I believe this is still a bug, but unfortunately, I sometimes rely on this "feature."
My experience is that current large models don't seem to be easily confused by path switching, but switching paths allows them to correctly utilize the AGENTS.md files I've set up in other paths.
Yes, this should be fixed! Unfortunately the TUI had a bug so this didn't fully work properly but that bug has been fixed in #30281 and will be out in the next release
Activity
github-actions commentedon May 21, 2026
This issue might be a duplicate of existing issues. Please check:
Instance.directory) rather than the session's storeddirectory. That issue was closed but the behaviour you describe appears to still be present.jensenojs commentedon Jun 2, 2026
At present, it seems that this issue has been "resolved" in a certain sense. If you resume through a different path, the conversation cannot continue, and the interface will freeze (though the conversation itself continues). I believe this is still a bug, but unfortunately, I sometimes rely on this "feature."
My experience is that current large models don't seem to be easily confused by path switching, but switching paths allows them to correctly utilize the AGENTS.md files I've set up in other paths.
ualtinok commentedon Jun 2, 2026
Oh I forgot to link the PR which solves this issue:
#28582
jlongster commentedon Jun 2, 2026
Yes, this should be fixed! Unfortunately the TUI had a bug so this didn't fully work properly but that bug has been fixed in #30281 and will be out in the next release