Skip to content

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

Description

@jackstine

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions