Task system session title leaks into main session (should be subagent/bg-task only)
Resolved 💬 2 comments Opened May 22, 2026 by pcor-neoword Closed May 26, 2026
Summary
The blue session title label in the CLI statusline (e.g. subagent-foobar-name) appears in the main interactive session even when the task was created as part of a subagent or background task workflow. Users expect this label to only appear for subagents and background tasks — not the primary session.
Steps to Reproduce
- Run a workflow that spawns subagents (e.g. via
Agenttool withsubagent_type=Exploreor similar) - Subagent creates or completes a task with a descriptive name
- Main session statusline picks up the task name as its session title
- Title persists in the main session even after subagent completes
Expected Behavior
- Session title in statusline should reflect the main session context (blank, or user-defined)
- Subagent/background task names should only appear in their own task context
- Main session title should not be overwritten by task names from child agents
Actual Behavior
Main session shows a task-derived title (e.g. subagent-foobar-name) that belongs to a completed subagent. The only way to clear it is /clear or closing/reopening the session.
Environment
- Claude Code CLI
- Task tools: TaskCreate / TaskUpdate used in subagent workflows
- Statusline enabled
Suggested Fix / Enhancement
- Scope task-derived session titles to the agent context that owns the task
- Main session title should be isolated from child agent task state
- Alternatively: provide a
/title clearor/title resetcommand to manually reset the statusline label
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗