Tasks

Task

A task read from Claude Code’s native task store (~/.claude/tasks/<list-id>/<id>.json).

Usage

Source

Task(
    *,
    id,
    subject,
    status,
    description="",
    owner=None,
    blocked_by=(),
    blocks=()
)

Parameter Attributes

id: str
subject: str
status: str
description: str = ""
owner: str | None = None
blocked_by: tuple[str, …] = ()
blocks: tuple[str, …] = ()

Tasks

The live task list for one session, read from the native store rather than the transcript.

Usage

Source

Tasks(tasks=())

Always keyed by the exact list id (session id) — a session with no store has no tasks, never another session’s. This is the source of truth for completion gates; transcript-derived task_ops() misses updates made by subagents, teammates, or resumed sessions.

Parameter Attributes

tasks: tuple[Task, …] = ()

Methods

Name Description
for_session() Load the task list for session_id, empty when absent.
resolve_root() Resolve the root of Claude Code’s native task store (<config-dir>/tasks).
for_session()

Load the task list for session_id, empty when absent.

Usage

Source

for_session(session_id, *, root=None)

Claude Code names the store dir either by the exact session id (legacy) or session-<first-8-chars> (current); an exact-id dir wins over the truncated one.

resolve_root()

Resolve the root of Claude Code’s native task store (<config-dir>/tasks).

Usage

Source

resolve_root()