---
name: command-start
description: Create an audit session with context recovery before starting work. Use when beginning a new task, analysis, or code modification — establishes a session for tracking tool usage, user corrections, and decisions. Examples: "start", "begin session", "start work", "/start 'migrate database schema'".
allowed-tools:
  - Read
  - Glob
  - Grep
  - Bash
  - Write
---

# /start — Audit Session Start + Context Recovery

## Trigger

```
/start "task description"
```

## Why

Every task should run in an audit session. Without one:
- Tool-use data goes to unnamed sessions with no task context
- `/end` can't run integrity checks
- Daily reports miss task descriptions

## Steps

### 1. Create session

Generate `session_id = adhoc_YYYYMMDD_HHMM`, create `.boo/runs/{session_id}/`, write `session.json`:

```json
{
  "session_id": "adhoc_20260320_1400",
  "task": "task description",
  "start_time": "ISO 8601",
  "status": "in_progress",
  "expected_record_types": ["data", "change", "conversation"]
}
```

Write session_id to `.boo/runs/.current_session` (the Stop hook reads this for buffer archiving).

### 2. Context recovery (L0 + L2)

**L0 — Index summary**: read `.boo/runs/index.json`, last 5 entries.

**L2 — User corrections (critical)**: scan all `audit_trail.jsonl` and `audit_pending.jsonl` for `user_correction` records — these must be restored first to avoid repeating mistakes.

**Check for unfinished sessions**: scan `.boo/runs/adhoc_*/session.json` for `status: "in_progress"`. If found, prompt the user to continue the old session instead.

### 3. Output summary

```
Session created: adhoc_20260320_1400
Task: {description}

Context recovery:
  Recent activity: {last 3 completed tasks}
  User corrections (must follow): {all user_correction records}
  Unresolved issues: {open anomalies/alerts}
  Today's priorities: {from morning review}

All [AUDIT] blocks use batch_id = {session_id}
```

### 4. Notes

- If `.boo/runs/` doesn't exist, create it and skip recovery
- If `.current_session` already points to an in_progress session, prompt before creating a new one
- The session_id stays constant for the whole session — all [AUDIT] blocks share it
