## Tasks


## Task


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


Usage

``` python
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

``` python
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[`<a href="tasks.html#captain_hook.Task" class="gdls-link gdls-code"><code>Task</code></a>`, …] = ()`    


#### Methods

| Name | Description |
|----|----|
| [for_session()](#captain_hook.Tasks.for_session) | Load the task list for `session_id`, empty when absent. |
| [resolve_root()](#captain_hook.Tasks.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

``` python
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

``` python
resolve_root()
```
