usage_link
Link Codex/Claude Code session transcripts to a Task Passport so usage_report can report tasks by ID. Lists candidates, links confirmed sessions, and manages unlink/coverage.
Instructions
Link Codex/Claude Code session transcripts to a Task Passport so usage_report can report the task by id. Without pick, file, remove or coverage it only lists candidate sessions of the task worktree with requests while the task was current. Show candidates to the user and link only what they confirm: pick links sessions by session id (numbers can shift between calls); client/file/turns links an explicit one. Re-linking a file replaces its selection; remove unlinks a linked file by path or session id (traced sessions are always included). Writes .agentpack/usage/.json only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Explicit local JSONL path; relative paths resolve from the pack root. | |
| json | No | Return JSON instead of human-readable text. | |
| note | No | Coverage note; requires coverage. | |
| pick | No | Candidate session ids (preferred) or numbers from the listing to link. | |
| task | No | Task Passport id; omit for the current task. | |
| phase | No | Phase label for the linked sources. Default main. | |
| turns | No | Inclusive N, N: (to the end) or N:M turn selection for file. | |
| client | No | ||
| remove | No | Linked JSONL path or session id to unlink; exclusive with other link options. | |
| coverage | No | Declared coverage; requires note. |