opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[Feature] Mirror parent session name to child sessions

Open fglogan opened this issue 1 month ago • 1 comments

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:

  1. Identify which child sessions relate to which work context
  2. Navigate between related sessions
  3. 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

  1. On parent rename: All existing child sessions update their names to reflect the new parent name
  2. On child spawn: New child session automatically inherits parent name with incremented suffix
  3. 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-analyzer session with 3 child tasks
  • opencode-plugin session 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.

fglogan avatar Dec 15 '25 20:12 fglogan

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.

github-actions[bot] avatar Dec 15 '25 20:12 github-actions[bot]