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
Multiple local clones of same repo share one project identity, breaking file change tracking #17940
When you have multiple local clones of the same git repository (same remote origin URL), OpenCode treats them all as a single project. This breaks file change tracking and causes visual issues in the project selector.
Environment
OpenCode version: 1.1.53
OS: Linux (Ubuntu)
Three local clones of the same repo in separate directories:
OpenCode generates the project ID from the git remote origin URL rather than the local directory path. This means all three clones resolve to the same project ID (e.g. 5ca09febb1b87758aeeb2c8949774a8bbafc6c8f), sharing a single project record and a single snapshot directory.
Consequences
File change tracking breaks — The snapshot git config's worktree can only point to one directory at a time. Whichever clone was opened last overwrites the worktree path, so file changes are not detected in the other clones. In my case, the snapshot pointed to project-8080 while I was working in project-8000, so session file diffs were always empty.
Project selector shows wrong colors — On the project selection screen, each clone initially has a distinct icon color. But once you select any one of them, all three switch to the same color because they share the same project record and icon.color value.
Only one project record exists — There is a single JSON file in ~/.local/share/opencode/storage/project/ for all three directories, with only one worktree value.
Expected Behavior
Each local directory should be treated as a separate project, even if they share the same git remote URL. The project ID should incorporate the local worktree path (or some other disambiguator) so that:
Each clone gets its own snapshot directory with the correct worktree path
File change tracking works independently in each clone
Each clone can have its own icon color and name in the project selector
Workaround
Manually deleting the snapshot directory (~/.local/share/opencode/snapshot/<project_id>) and restarting OpenCode causes it to recreate the snapshot with the correct worktree for the currently active clone — but this only fixes one clone at a time and the underlying identity collision remains.
Reacted by Diogo Sousa, xlht4106, Vampire, Sven Palberg and 3m4r5
Session history being shared between multiple copies of the same git repository is a crucial fixture on which many people rely. I hope that this does not interfere with that.
+1 for this. I've multiple clones of the same crate to let agents work on different things in parallel. (I know git worktree exists, there are reasons not to like it).
As stated in the presumed duplicate #29871: the WebUI of OpenCode 1.17.6 is still affected by this bug.
I tried the workaround of this report, but this alone did not help.
Then I also deleted all cookies of localhost:4096, deleted every file in all /*opencode directories that contained the wrong project name, tried to manually delete all entries from the SQLite opencode.db containing the wrong project name. But creating the new session still showed the wrong path! 🤯
Then I deleted cookies again and(!) restarted the browser. This finally made the wrong path disappear!
So try the workaround above, while opencode and your browser do not run!
Activity
github-actions commentedon Mar 17, 2026
This issue might be a duplicate of existing issues. Please check:
fix(project): use path-aware project identity to prevent clone collis…
ariane-emory commentedon Mar 17, 2026
Session history being shared between multiple copies of the same git repository is a crucial fixture on which many people rely. I hope that this does not interfere with that.
orium commentedon May 29, 2026
+1 for this. I've multiple clones of the same crate to let agents work on different things in parallel. (I know git worktree exists, there are reasons not to like it).
xlht4106 commentedon May 29, 2026
希望能加一个选项能让用户自主选择是否合并会话记录。
taina0407 commentedon May 30, 2026
+1 for this as well. I'm also prefer different working directory for different features and .env rather than rely only from git worktree
oliver-joos commentedon Jun 14, 2026
As stated in the presumed duplicate #29871: the WebUI of OpenCode 1.17.6 is still affected by this bug.
I tried the workaround of this report, but this alone did not help.
Then I also deleted all cookies of localhost:4096, deleted every file in all
/*opencodedirectories that contained the wrong project name, tried to manually delete all entries from the SQLite opencode.db containing the wrong project name. But creating the new session still showed the wrong path! 🤯Then I deleted cookies again and(!) restarted the browser. This finally made the wrong path disappear!
So try the workaround above, while opencode and your browser do not run!
github-actions commentedon Aug 14, 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.
Hona commentedon Sep 2, 2026
Fixed for opencode2 launch via #46713
You can try the desktop beta here: https://github.com/anomalyco/opencode-beta