[Feature] Mirror parent session name to child sessions
Summary
When a session is renamed, child sessions should reflect the parent session name with a suffix (e.g., genesis-analyzer parent spawns genesis-analyzer|cs-1, genesis-analyzer|cs-2, etc.).
Problem
Currently, child sessions spawned by the Task tool have generic or auto-generated names that don't indicate which parent session they belong to. This makes it difficult to:
- Identify which child sessions relate to which work context
- Navigate between related sessions
- Understand session hierarchy at a glance
Proposed Solution
Naming Convention
When a parent session is named <session-name>, child sessions should be named:
-
<session-name>|cs-1 -
<session-name>|cs-2 - etc.
Or alternatively:
-
<session-name> [1] -
<session-name> [2]
Behavior
- On parent rename: All existing child sessions update their names to reflect the new parent name
- On child spawn: New child session automatically inherits parent name with incremented suffix
-
Session list display: Show hierarchy clearly, perhaps with indentation:
genesis-analyzer ├─ genesis-analyzer|cs-1 (completed) ├─ genesis-analyzer|cs-2 (running) └─ genesis-analyzer|cs-3 (pending)
Use Case
When working on multiple projects simultaneously, users may have:
-
genesis-analyzersession with 3 child tasks -
opencode-pluginsession with 2 child tasks
Without name mirroring, it's unclear which child sessions belong to which context.
Additional Context
This improves the UX when using agents heavily, as the Task tool spawns many child sessions that currently lack clear association with their parent context.
This issue is related to existing discussions about session management and naming. Please check:
- #4040: Session auto naming - discusses automatic session naming functionality
- #5578: Custom command to cycle between child sessions - proposes alternatives for navigating child sessions
- #3291: Navigation to parent session from child/subagent sessions - discusses parent-child navigation keybinds
- #4133: Use a cheap model to name sessions - discusses session naming efficiency
These issues cover related aspects of session hierarchy and naming conventions. Feel free to cross-reference for context on how child sessions are managed.