anomalyco / anomalyco/opencode
[FEATURE]: Allow renaming/moving a project folder while persisting session history (replacement for stale-closed #25625)
@jlongster is already working on this.
Since Aug 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
This is a replacement for #25625, which was auto-closed by the stale bot after 60 days of inactivity with an invitation to open a new issue. The underlying problem is still live: #23248 (sessions becoming orphaned when the project directory is renamed) remains open, and its companion request #23249 was closed by the same bot.
Renaming or moving a project folder currently orphans all sessions of that project: history becomes unreachable from the UI because session identity is tied to the old path.
Proposal
Support renaming/moving a project folder while persisting session history, proactively rather than via manual recovery:
- On startup (or when a configured worktree path is missing), detect that a previously known project path no longer exists.
- Offer to re-link the orphaned sessions to the relocated folder (e.g. match by git remote URL and/or content heuristics), instead of silently dropping them out of the session list.
- Keep the historical path as metadata so past sessions remain attributable even if re-linking is declined.
#23249 proposed an interactive migration dialog for already-orphaned sessions; this request is about preventing the orphaning in the first place by handling renames/moves as first-class events. Both can coexist: prevention for known moves, recovery for missed ones.
Why not a duplicate
#23248 describes the symptom; this proposes the proactive fix. The distinction was already made on #25625 before its closure.
Environment
- App: OpenCode Desktop 1.18.21
- OS: Microsoft Windows 11 Education, 25H2, build 26200.8875
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.