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]: Allow changing project folder path without losing session history #29703
When I change the project folder path (e.g., rename a directory, move to a different location, or reorganize folder structure), all my previous chat history and session data for that project are lost.
This happens because OpenCode stores session data tied to the project folder path. If the path changes, OpenCode treats it as a new project.
Use Cases
Renaming project folder - When I rename my-project to my-project-v2, I lose all previous conversation context
Moving project location - When I move a project from ~/dev/ to ~/work/, sessions are gone
Restructuring workspace - Reorganizing folders by category/type breaks session continuity
Git repo migration - When transferring repos between organizations, the folder structure changes
Suggested Solution
Option A: Session aliasing/mapping
Allow users to link/migrate session data when a folder path changes
Add a command like opencode session migrate --from /old/path --to /new/path
Option B: Use project identifier instead of path
Store sessions based on a unique project ID (e.g., git remote URL, or a generated UUID)
Create a .opencode/project.json config that identifies the project
changed the title [-]feat: Allow changing project folder path without losing session history[/-][+][FEATURE]: Allow changing project folder path without losing session history[/+]on May 28, 2026
Thank you for updating the issue! It now meets our contributing guidelines. We appreciate you taking the time to add the [FEATURE]: prefix and fill in your environment details.
It was wrongly closed by the bot and the maintainers seem to have a hard time to keep up with everything and they have not repoened my PR. I have been using this dialog daily on my local machine for a big month. You can go a put a thumbs up on that PR/issue and may be comment in the issue to show your support for the functionality. Otherwise, the bot criteria for keeping issues opened will keep closing my PR.
Consider also closing this issue if you agree to keep the conversation over at #23249.
Thanks!
Reacted by BrettB, NicolasWebDev, mihaulem, Ratmir Mukazhanov, Bret Mogilefsky, endolith and Mikael Vallenet
+1 — hit this exact scenario on Windows 11 + WSL2. Renamed a project folder and lost all session history. The sessions are technically still in the SQLite DB but orphaned because their directory field stores the old absolute path.
This feature would be very welcome. Even a simple "relink project directory" button in Desktop settings would be enough — no need for automatic detection, just let users manually point an existing project record to a new path and batch-update all associated session directory fields.
Any automated approach won't support the use case of moving a session from one existing and functional location to another. This was mentioned in #23249 and covered by #23250.
However, both were closed by bots unfortunately. This is disappointing as I do use this feature every day using #23250 locally. The auto ticket closing policy is a real mess. It doesn't distinguish good tickets from anything else. That's a shame.
@predystopic-dev this issue is about being able to change the path of a project, without losing its session history. E.g. mv ~/my_project ~/other_dir/my_project. https://github.com/moha-abdi/opencode-move-session on the other hand, moves a session from projectA to projectB.
Different objectives.
Moreover it didn't work when I tried it, at least for me. I had an sql command error.
Activity
[-]feat: Allow changing project folder path without losing session history[/-][+][FEATURE]: Allow changing project folder path without losing session history[/+]github-actions commentedon May 28, 2026
Thank you for updating the issue! It now meets our contributing guidelines. We appreciate you taking the time to add the
[FEATURE]:prefix and fill in your environment details.github-actions commentedon May 28, 2026
Thanks for updating the issue! It now meets our contributing guidelines. We'll take a look.
sim590 commentedon May 31, 2026
@yun-langdeng: this is a duplicate of #23249. There's already a PR for this: #23250.
It was wrongly closed by the bot and the maintainers seem to have a hard time to keep up with everything and they have not repoened my PR. I have been using this dialog daily on my local machine for a big month. You can go a put a thumbs up on that PR/issue and may be comment in the issue to show your support for the functionality. Otherwise, the bot criteria for keeping issues opened will keep closing my PR.
Consider also closing this issue if you agree to keep the conversation over at #23249.
Thanks!
WhiteGiverMa commentedon Jun 21, 2026
+1 — hit this exact scenario on Windows 11 + WSL2. Renamed a project folder and lost all session history. The sessions are technically still in the SQLite DB but orphaned because their
directoryfield stores the old absolute path.This feature would be very welcome. Even a simple "relink project directory" button in Desktop settings would be enough — no need for automatic detection, just let users manually point an existing project record to a new path and batch-update all associated session
directoryfields.DriftN2Forty commentedon Jul 20, 2026
I believe this now works automatically. I just manually moved a project folder and all sessions are available when I opened the project.
NicolasWebDev commentedon Jul 21, 2026
It still doesn't work for me on archlinux, with opencode TUI 1.17.20-1, nor with 1.18.4-1.
sim590 commentedon Jul 22, 2026
Any automated approach won't support the use case of moving a session from one existing and functional location to another. This was mentioned in #23249 and covered by #23250.
However, both were closed by bots unfortunately. This is disappointing as I do use this feature every day using #23250 locally. The auto ticket closing policy is a real mess. It doesn't distinguish good tickets from anything else. That's a shame.
predystopic-dev commentedon Jul 27, 2026
A plugin exists for the very same purpose
https://github.com/moha-abdi/opencode-move-session/tree/main
NicolasWebDev commentedon Jul 27, 2026
@predystopic-dev this issue is about being able to change the path of a project, without losing its session history. E.g.
mv ~/my_project ~/other_dir/my_project.https://github.com/moha-abdi/opencode-move-session on the other hand, moves a session from projectA to projectB.
Different objectives.
Moreover it didn't work when I tried it, at least for me. I had an sql command error.
github-actions commentedon Sep 26, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.