Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem
After using /fork to branch from a previous message, there's no way to navigate back to the parent conversation or view all branches in the session tree. Users must manually switch between sessions or lose access to previous branches.
Proposed Solution
Implement a /tree command (similar to pi-mono) that provides:
- Visual tree browser - ASCII art visualization of the entire session tree showing all branches
- Active path highlighting - Shows which branch is currently active
- Branch navigation - Click/keyboard to switch between any message in the tree
- Optional branch summaries - When leaving a branch, optionally generate an AI summary of the abandoned conversation path
Key Features
- Navigate to any previous message without losing current branch
- Visual representation of all conversation paths
- Keyboard-driven interface (arrow keys, enter to select)
- Optional labels/bookmarks for quick reference
Reference Implementation
The pi-mono coding agent has a working implementation:
- Session stored as append-only tree with
parent_id tracking
/tree command opens visual selector (tree-selector.ts)
branch() method moves leaf pointer without modifying history
- Supports labels, folding, and filtering
Technical Approach (High-Level)
- Add
parent_id to messages table for tree structure
- Add
leaf_id to sessions table for current position tracking
- Implement tree traversal logic in core session module
- Add
/tree slash command
- Build tree selector UI component
Why This Belongs in OpenCode
Session branching is a first-class feature via /fork, but lacks proper navigation tools. A tree view makes branching discoverable and usable, encouraging users to explore different approaches without fear of losing work.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem
After using
/forkto branch from a previous message, there's no way to navigate back to the parent conversation or view all branches in the session tree. Users must manually switch between sessions or lose access to previous branches.Proposed Solution
Implement a
/treecommand (similar to pi-mono) that provides:Key Features
Reference Implementation
The pi-mono coding agent has a working implementation:
parent_idtracking/treecommand opens visual selector (tree-selector.ts)branch()method moves leaf pointer without modifying historyTechnical Approach (High-Level)
parent_idto messages table for tree structureleaf_idto sessions table for current position tracking/treeslash commandWhy This Belongs in OpenCode
Session branching is a first-class feature via
/fork, but lacks proper navigation tools. A tree view makes branching discoverable and usable, encouraging users to explore different approaches without fear of losing work.