Skip to main content

Module tasks

Module tasks 

Source
Expand description

Read-side access to Claude Code’s on-disk task-tool state.

The task tools (TaskCreate / TaskUpdate) persist one JSON file per task item under ~/.claude/tasks/<session-id>/<n>.json:

{
  "id": "1",
  "subject": "Untrack the local config artifact",
  "description": "...",
  "activeForm": "Untracking the local config artifact",
  "status": "completed",
  "blocks": [],
  "blockedBy": []
}

This module lists and parses them; it is read-only on purpose, like the other introspection modules. The layout is undocumented Claude Code internal state (observed against CLI 2.1.219) and can change across CLI versions, so parsing is defensive: every typed field is Option-shaped, a field with an unexpected JSON type stays in Task::rest, and unknown fields land there too.

§Example

use claude_wrapper::tasks::TasksRoot;

let root = TasksRoot::home()?;
for list in root.list_sessions()? {
    println!("{}: {} tasks", list.session_id, list.task_count);
}

Structs§

Task
One task item parsed from <n>.json.
TaskListSummary
One session that has task-tool state, returned by TasksRoot::list_sessions.
TasksRoot
Root directory of Claude Code’s task-tool state. Defaults to ~/.claude/tasks; override with TasksRoot::at for tests or non-default installs.