# Standalone review: its own tracker record

A standalone review (the command seeded a `review-` id, so no pipeline run
owns this session) registers itself, so its progress shows wherever runs
are read (the office panel, `/multi-agent:status`). Inside a pipeline run the
run's own tracker already covers it; skip this block.

```bash
case "$TASK_ID" in review-*)
  S="${LOGS_ROOT:-$HOME/.claude/logs/multi-agent}/$TASK_ID"; mkdir -p "$S"
  printf '{"taskId":"%s","mode":"review","status":"in_progress","currentPhase":0}' "$TASK_ID" \
    | node "$HOME/.claude/scripts/write-state.mjs" "$S/agent-state.json" >/dev/null
  export MULTI_AGENT_TASK_ID="$TASK_ID"
  bash "$HOME/.claude/scripts/phase-tracker.sh" init "$TASK_ID"
  for p in "0:Input" "1:Diff" "2:Reviewers" "3:Triage" "4:Report"; do
    bash "$HOME/.claude/scripts/phase-tracker.sh" add "${p%%:*}" "${p#*:}"
  done
  bash "$HOME/.claude/scripts/phase-tracker.sh" update 0 in_progress ;;
esac
```

Step 1 (1, 1a) is tracker step 0, step 2 (2-2c) step 1, steps 3-4b step 2,
step 5 step 3 and steps 6-7 step 4: `update <N> in_progress` on entry and `completed` on exit. Each later
call runs in a new shell where `$TASK_ID` is no longer set, so it carries the
review's id written out literally (the `review-...` value the registration
used) and refuses the global pointer, which another run's `init` can move:

```bash
MULTI_AGENT_TASK_ID=review-1 MULTI_AGENT_STRICT_TASK_ID=1 \
  bash "$HOME/.claude/scripts/phase-tracker.sh" update 2 completed
```

After step 7 a standalone review closes its record with the same `write-state.mjs` call and
`"status":"complete","currentPhase":4`.

Reviewer token counts (`phase-tracker.sh tokens <N> ...`) go under step 2
(Reviewers); inside a pipeline run they go under the run's Review phase.
