Tasks
Task
A task read from Claude Code’s native task store (~/.claude/tasks/<list-id>/<id>.json).
Usage
Task(
*,
id,
subject,
status,
description="",
owner=None,
blocked_by=(),
blocks=()
)Parameter Attributes
id: strsubject: strstatus: strdescription: str = ""owner: str | None = Noneblocked_by: tuple[str, …] = ()blocks: tuple[str, …] = ()
Tasks
The live task list for one session, read from the native store rather than the transcript.
Usage
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.
|
| list_id() | Resolve the id of the task list a session writes to. |
| 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
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.
list_id()
Resolve the id of the task list a session writes to.
Usage
list_id(session_id, transcript_path)An explicit CLAUDE_CODE_TASK_LIST_ID wins. A team lead’s list is named after its team, recorded in the teamName of its teammates’ subagents/*.meta.json beside the transcript. Each resume of a lead starts a new team, so one transcript can carry several; the list is the team of the most recently written teammate meta. Otherwise the list is the session’s own.
resolve_root()
Resolve the root of Claude Code’s native task store (<config-dir>/tasks).
Usage
resolve_root()