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
Session data is keyed by absolute path, breaking context when reorganizing folders #48254
OpenCode stores per-project session data in ~/.local/share/opencode/project//storage/, where is derived from the absolute path of the working directory. Moving a project to a different folder (e.g. ~/Documents/repo → ~/Documents/new/repo) causes OpenCode to treat it as a brand-new project: the previous session history is no longer accessible from the new location, and the project appears to have lost all context.
Steps to reproduce:
Start OpenCode in ~/Documents/my-project and have a conversation.
Move the folder: mv ~/Documents/my-project ~/Documents/new/my-project.
Run opencode again from the new path.
Observe: previous sessions are not listed (opencode session list), --continue fails, and the model has no context from the prior conversation.
Expected behavior: Sessions should be tied to the project's identity, not its absolute path on disk. Reasonable identifiers:
Git remote URL (if a repo)
Repository root resolved via .git traversal
AGENTS.md / .opencode/ location
Moving or renaming the project directory should not orphan the conversation history.
Impact: Users who reorganize their folder structure (a very common operation: splitting work into subfolders, restructuring monorepos, moving projects to a new drive, syncing via symlinks, etc.) permanently lose all session context. This makes OpenCode fragile for any non-trivial workflow and forces users to either keep projects at fixed absolute paths or rely on symlinks.
Proposed solutions (any of these would help):
Key the slug by git remote URL when available, fall back to absolute path only for non-git projects.
Detect folder moves and offer to migrate/reassociate existing session data.
Add an opencode session migrate command.
Allow manual session reassociation via a config file or CLI flag.
Environment:
If your issue is specifically about using git remote URL or repository root as the stable project key (rather than absolute path), you may want to comment on one of the open issues above rather than opening a new one.
Activity
github-actions commentedon Sep 10, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is specifically about using git remote URL or repository root as the stable project key (rather than absolute path), you may want to comment on one of the open issues above rather than opening a new one.
Tarquinen commentedon Oct 20, 2026
We're tracking this in #44256, so I'm closing this as a duplicate. Please follow that issue for updates.
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊