Repository navigation
Add interactive session switcher for navigating between subagent sessions #6183
Description
Problem
When working with subagent sessions (e.g., tasks spawned by the task tool), navigation currently requires cycling through sessions one-by-one using <leader>right / <leader>left. This becomes inefficient when:
- Multiple subagents are spawned from a single parent session
- Subagents spawn their own subagents (nested hierarchy)
- You need to jump directly to a specific session (e.g., one awaiting permission input)
There's no way to see all related sessions at once or jump directly to a specific one.
Proposed Solution
Add an interactive session switcher dialog that:
- Shows hierarchical view of parent and all descendant sessions (up to 3 levels deep)
- Displays session status - busy spinner for active sessions, permission indicator for sessions awaiting user input
- Allows direct navigation - select any session from the list instead of cycling through sequentially
- Integrates with command palette - appears in suggested commands when subagents exist
Keybind
<leader>s (configurable via session_child_list)
UI Example
Switch Session
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Parent
● Main session title 2m ago
Subagents
explore task 1m ago
code-review task 45s ago
Subagents › explore
◉ nested-search task 30s ago
●indicates current session◉(warning color) indicates session awaiting permission- Spinner shown for busy/active sessions
Why This Is Useful
Direct selection is significantly more efficient than sequential cycling when you have 5+ subagent sessions and need to:
- Check on a specific task's progress
- Respond to a permission prompt in a nested subagent
- Return to the parent session after reviewing children
Implementation Approach
The implementation reuses existing patterns from the codebase:
DialogSelectcomponent for the selection UI (same asDialogSessionList,DialogTimeline)sync.data.permission[sessionID]for pending permission detectionsync.data.session_status[sessionID]for busy state detection- Category grouping for hierarchical display (same pattern as date grouping in
DialogSessionList)
Style note
The implementation uses a let statement when walking up the session tree to find the root parent:
let current = currentSession()
while (current?.parentID) {
const parent = sync.session.get(current.parentID)
if (!parent) break
current = parent
}This is a legitimate use case where let is appropriate - the variable must be reassigned during iterative traversal. Per the style guide, let should be avoided where possible, but not prohibited when it's the natural solution.
Activity
github-actions commentedon Dec 26, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rmk40 commentedon Dec 26, 2025
After reviewing the related issues:
This PR (#6184) addresses the core problem shared across these issues:
Feature Request: Agent Session Tab Bar Navigation #5826 (Tab Bar Navigation) and [FEATURE]: Nerdtree like session manager #6032 (Nerdtree session manager) - Both request visual session navigation. Our dialog provides a hierarchical view on-demand. A persistent tab bar or sidebar could complement this in the future.
Subagent Switching - Buggy #4727 (Subagent Switching - Buggy) - Users report lag when cycling through sessions. Our direct-selection approach bypasses cycling entirely, allowing users to jump directly to any session.
[Feature] Custom command to cycle between child sessions #5578 (Custom command to cycle) - Requests an alternative to keybinds that conflict with terminals. Our switcher is accessible via command palette (
ctrl+p), providing a keyboard-friendly alternative.The implementation is intentionally minimal - it reuses existing
DialogSelectpatterns and doesn't introduce new UI paradigms. It's designed to coexist with future enhancements like a persistent tab bar (#5826) or tree sidebar (#6032).Eric-GoodBoy-Tech commentedon Feb 27, 2026
Great work on this! 🎉
This would significantly improve the subagent navigation experience. A few suggestions that could complement this feature:
Status bar integration - Show subagent count/status in the bottom bar (e.g.,
3 subagents [1⏳ 2✓]) for quick visibility without opening the dialogAuto-switch options - Optional config to auto-switch when:
Plugin hooks - Expose subagent events (
created,permission_pending,completed) for plugins to monitor/manage sessionsThese would make the subagent workflow even more seamless. Thanks for driving this forward! 👍
feat(tui): add session tree dialog with visual hierarchy and status i…
github-actions commentedon Apr 29, 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.