Long-running agent workflows just got a lot more confusing. A developer on DEV.to uncovered a nasty edge case in Claude Code where tasks appear to vanish mid-run, despite the underlying files remaining intact. The culprit is the session-ID task store, which binds task metadata to ephemeral session identifiers. When those IDs shift, the UI drops tasks from view even though the work product persists on disk.

The Session ID Problem

The issue surfaced during a multi-agent orchestration run where the user experienced the phantom task disappearance four times in a single session. This isn't a file corruption bug or a true data loss event. Instead, it's a state-tracking failure. Claude Code's task store keys off the current session ID. If a sub-agent or a re-invocation spawns a new session context, the previous session's tasks become orphaned from the UI's perspective, even if their file artifacts remain perfectly valid.

Why It Matters for Multi-Agent Work

As Anthropic pushes harder into multi-agent architectures, state management becomes the primary bottleneck. Developers need to know that Claude Code's current task visibility is tightly coupled to session continuity. If your orchestration layer rotates sessions without carrying over task store references, you'll see this exact trap. The work is done, the files are there, but the agent forgets it ever scheduled the job.

Key Takeaways

  • Claude Code tasks are bound to session IDs, not just file paths.
  • Multi-agent runs that spawn new sessions can orphan task metadata.
  • File artifacts persist even when tasks disappear from the UI.
  • The bug was reproduced four times in a single multi-agent workflow.

The Bottom Line

Anthropic needs to decouple task state from session lifecycle. Right now, Claude Code treats agent identity as disposable, but your file system doesn't. Until the task store survives session rotation, multi-agent orchestration remains a minefield of false-positive data loss.