[BUG] Task-tool subagent transcripts are mirrored to the claude.ai/code session list as separate untitled sessions

Status Open
Reported on v2.1.212
Maintainer reply None cached
Activity 0 comments · opened Jul 23, 2026

Environment

  • Claude Code CLI: 2.1.212 (Claude Code desktop app)
  • OS: macOS 26.4 (Apple Silicon, MacBook Air)

Description

Transcripts of subagents launched via the Task tool — stored locally as
~/.claude/projects/<project>/<session-id>/subagents/agent-*.jsonl — are mirrored to the
claude.ai/code session list (and the desktop app sidebar) as independent sessions.
Since they have no title, they show up with auto-generated names such as
macbook-air-local-shiny-sun (device name + two random words).

One-shot headless runs (claude -p "hi") are mirrored the same way.
Agent SDK background sessions do not appear, which matches the documented behavior
that headless/SDK sessions are excluded from session pickers.

Steps to reproduce

  1. On macOS, in a Claude Code desktop session, run any request that spawns subagents via the Task tool.
  2. Open claude.ai/code (or the desktop sidebar) and watch the list.

Expected behavior

Subagent transcripts and one-shot headless runs should not be listed as standalone
sessions, consistent with how Agent SDK sessions and the CLI /resume picker treat them.

Actual behavior

Every subagent run adds one untitled <device>-local-<slug> entry. A normal working day
produces roughly 5–10 of them, so the list fills up with meaningless entries daily.
Deleting the local .jsonl files does not remove entries that were already synced.
The only cleanup available is archiving them one by one — there is no bulk archive and
no setting to exclude these transcripts from mirroring.

Impact

The session list becomes polluted to the point where real work sessions are hard to
find at a glance. Verified over 2026-07-18 → 2026-07-23: about 30 such entries had to be
archived manually.

Possibly related

  • #74367 (local session mirroring regression)
  • #60860 (spawn-task / local-agent-mode session orphaned)
  • #42242 (request: auto-clean orphaned Code sessions from sidebar)

View original on GitHub ↗