[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
- Start a session and create tasks with
TaskCreate - Set one to
in_progress - Work until the session is context-compacted
- Continue in the resumed/compacted session
- The task list still shows the old
in_progresstask — 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_progress→pending, or - Inject a note in the compaction summary reminding the agent to run
TaskListand clean up stale tasks
Environment
- Claude Code CLI (latest)
- macOS 14.6
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗