Tasks created via TaskCreate are lost during conversation compaction

Resolved 💬 3 comments Opened Apr 13, 2026 by arionrepo Closed May 28, 2026

Description

When a conversation is compacted (either manually via /compact or automatically at context limits), all tasks created via TaskCreate / TaskUpdate are permanently lost. There is no mechanism to persist or restore them.

Steps to Reproduce

  1. Start a Claude Code conversation
  2. Create multiple tasks using TaskCreate (e.g., 20+ tasks for a complex project)
  3. Work through tasks, updating status with TaskUpdate
  4. Trigger compaction (/compact or reach context limit)
  5. Run TaskList after compaction

Expected Behavior

Tasks should survive compaction, or at minimum:

  • Tasks should be included in the compaction summary
  • Or tasks should be persisted to a file before compaction
  • Or the task system should use file-backed storage instead of in-memory only

Actual Behavior

TaskList returns "No tasks found" after compaction. All task state (subjects, descriptions, statuses, dependencies) is completely lost with no way to recover.

Impact

For complex multi-step projects (in this case, 20+ design tasks across 12 modules), losing the task list means:

  • No record of what was completed vs pending
  • No record of task dependencies
  • User must manually reconstruct the entire task list from conversation memory
  • Risk of duplicated or missed work

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6 (1M context)
  • macOS Darwin 24.6.0

Suggested Fix

Either:

  1. Persist tasks to a file (e.g., .claude/tasks.json) so they survive compaction
  2. Include task state in compaction summary so they can be auto-reconstructed
  3. Warn before compaction if there are active tasks, giving the agent a chance to persist them

Workaround

Manually maintain a TODO.md file in the project directory mirroring all task state. This is what I'm now doing, but it defeats the purpose of the built-in task tools.

View original on GitHub ↗

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