---
description: "Show the agent-log.md for the given task. With no ID, shows the most recent task. Use when asked what a task did, or to read its log."
description-tr: "Verilen görevin agent-log.md dosyasını gösterir. ID verilmezse en son görevi gösterir."
argument-hint: "[#id]  -  optional: task ID (e.g. #3). If omitted, the most recent task is used."
---

# multi-agent log  -  Task Log Viewer

**Input**: $ARGUMENTS

Show the task's detailed agent-log.md report.

## Steps

1. **Parse task ID**  -  extract the `#N` form from the argument.
   - No argument → find the most recent (highest-ID) worktree.

2. **Find the worktree**  -  search the known repos. A task whose worktree was removed after its PR (Phase 6 finalize) is found under `$HOME/.claude/logs/multi-agent/<project>/<task-id>/` instead; the `agent-log.md` was always there, and `artifacts/agent-state.json` holds the state. Look there before reporting "task not found":
   ```bash
   find ~/my-ios-app/.worktrees/ ~/my-figma-app/.worktrees/ ~/my-ui-components/.worktrees/ -name "agent-state.json" -maxdepth 2 2>/dev/null
   ```
   - Pick the worktree whose `taskId` or short ID matches.

3. **Read agent-log.md**  -  display the file.

4. **Cost + durations come from the tracker, not only the log.** The tracker contract promises token/duration data "surfaced in `:log` reports", and agent-log.md only carries it when Phase 7 appended the Cost Breakdown. When that section is absent, render it live:
   ```bash
   bash $HOME/.claude/scripts/render-agent-log-cost.sh "<task-id>" 2>/dev/null
   ```
   Exit 2 means no tracker data exists  -  say so in one line (`cost unavailable: no token telemetry recorded`) instead of leaving the section out silently.

5. **Provide a summary**  -  when the log is long, show only the Timeline table + Review Consensus + the cost block, and give the file path for the full log.
