[BUG] /clear erases task list (TaskCreate/TaskList) despite persistence guarantee

Resolved 💬 3 comments Opened Mar 31, 2026 by jackstine Closed Apr 4, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Running /clear wipes out the task list created via TaskCreate, making all tasks inaccessible via TaskList. This contradicts the documented behavior which states tasks persist across context operations since they are stored on disk at ~/.claude/tasks/.

This issue was previously reported in #18081 and #23316, both of which were closed as stale/duplicate without a fix being shipped. The bug is still reproducible on the latest version.

Repro:

  1. Start a Claude Code session
  2. Create a task using TaskCreate with any subject/description
  3. Verify the task exists via TaskList
  4. Run /clear
  5. Run TaskList again

Expected: Task persists — it is stored on disk, not in conversation memory
Actual: TaskList returns "No tasks found"

What Should Happen?

/clear should only clear conversation history. Tasks stored in ~/.claude/tasks/ should remain accessible via TaskList after /clear because they are a disk-based construct, not an in-memory/conversation construct.

Error Messages/Logs

> TaskList
No tasks found

Steps to Reproduce

  1. Start a Claude Code session in any project
  2. Create a task: TaskCreate with subject "Test task"
  3. Confirm it exists: TaskList → task appears
  4. Run /clear
  5. Run TaskList again → "No tasks found"

Related Issues

  • #18081 — closed as stale (unresolved)
  • #23316 — closed as duplicate of #18081 (also unresolved)

Claude Model

claude-sonnet-4-6

Is this a regression?

No — this has been present across multiple versions per the referenced issues

Claude Code Version

Latest (2.x)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

The workaround of using CLAUDE_CODE_TASK_LIST_ID=my-project claude to name a task list may help in some cases, but the core bug — that /clear destroys disk-persisted tasks — should be fixed so the tool behaves as documented.

View original on GitHub ↗

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