anomalyco / anomalyco/opencode
[FEATURE] Session tree: branch history, rollback-and-continue from any message, branch navigation (like Pi)
Open
@nexxeln is already working on this.
Since Aug 9, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature request
Pi (earendil-works) has tree-shaped session history: you can go back to any earlier point in the conversation, fork a new branch there, and navigate the branches like a git history. OpenCode only has a single-level fork/compact — no way to revisit earlier states of the same session.
What I'd like
In the Desktop app (and TUI):
- Session timeline / tree view: every fork creates a branch; you can see the whole tree of a session (like a git graph).
- Rollback to any node: select any earlier message → "continue from here" creates a child branch without losing the current branch (i.e., an explicit
forkat any point, not just at continue). - Branch navigation: switch between branches of the same session, diff summaries between branches.
- Visualization: sidebar tab "History/Timeline" in desktop app.
Why
- Current behavior:
--fork/ fork in desktop clones the whole session; you cannot see where in the conversation the fork happened, and multiple alternative explorations quickly become unmanageable (100+ sessions). - For debugging AI workflows (try idea A, try idea B from the same point, compare) it's the single most effective pattern.
- Pi has shown the UX; OpenCode has the storage (messages are already stored) — mainly a UI + routing change.
Related
- #34430 (closed: V2 session.fork API) — the API exists; this is the user-facing tree UI.
- #38558 (session.generate contract) — relevant to how branches export.
Proposal
- Treat every session as a DAG/branch tree in storage (parent_id on messages).
- Add
/treeslash command or sidebar tab: shows branch nodes, lets you jump/continue. --forkbecomes "create branch at latest message", new--fork <msg-id>to fork at any message.
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.