[BUG] Tasks persist as stale/in-progress after context compaction

Resolved 💬 3 comments Opened Mar 1, 2026 by gpeyton Closed Mar 4, 2026

Description

When a Claude Code session hits context limits and is compacted, any tasks created via TaskCreate that are still in_progress or pending are not cleaned up. They remain visible in subsequent sessions, falsely implying work is actively happening.

Steps to Reproduce

  1. Start a session and create tasks with TaskCreate
  2. Set one to in_progress
  3. Work until the session is context-compacted
  4. Continue in the resumed/compacted session
  5. The task list still shows the old in_progress task — no active work is running

Expected Behavior

After context compaction, stale in_progress tasks should be reset or a system reminder should prompt the agent to reconcile the task list at session start.

Actual Behavior

Tasks remain with their pre-compaction status indefinitely. Users see in_progress tasks and reasonably assume something is running in the background when nothing is.

Suggested Fix

On compaction, either:

  • Automatically reset in_progresspending, or
  • Inject a note in the compaction summary reminding the agent to run TaskList and clean up stale tasks

Environment

  • Claude Code CLI (latest)
  • macOS 14.6

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗