# Pilot guide: test the method on your own repository

Version 0.2.0. Latest version: https://hamedtaheri.com/playbook/latest/agent/pilot.md (this copy is release 0.2.0)

For the AI helping a person run the pilot. The goal is an initial test on three small tasks that records cost, acceptance, human time and repairs. Setup time depends on the repository.

**Budget first.** Agree a total budget covering preparation, workers, reviews and retries before starting. A $2 worker setting is not a $2 whole-task limit: the CLI can overshoot by one call, and other stages add cost. Reserve headroom and stop before the approved total is exhausted.

**Confirm before you start:** the repository, the three tasks, the budget, and that runs happen on new local branches only. Never push to shared branches, merge, deploy or touch production during the pilot.

## Step 1. Record the baseline (10 minutes)

Ask the person how a task like these usually runs today: which tool, roughly how long, how many back-and-forth prompts, and whether they know what it costs. If they don't know the cost, write "unknown". That is a finding too.

**Done when:** tool, time, prompts and cost are written down, with "unknown" where the person doesn't know.

## Step 2. Pick three tasks (10 minutes)

Good pilot tasks are real, small and checkable: something a junior engineer could finish in an hour or two, touching at most about eight files, with tests that can prove it works. Avoid tasks that need production access, product decisions nobody has made, or a schema shared with other in-flight work.

**Done when:** the person has named three tasks that pass these tests.

## Step 3. Write three six-field briefs (30 minutes, together)

Read the relevant code first. For each task write:

1. **Outcome:** the observable result.
2. **Acceptance:** numbered checks a reviewer can verify without this conversation.
3. **Spec:** the issue or design it comes from, and the current commit.
4. **Files:** what to create or edit, with exact `path:start-end` ranges for the code that matters. Paste those ranges into the brief.
5. **Verification:** the exact test and build commands.
6. **Branch:** `pilot/<task>`, created from the current main branch.

If a task touches auth, billing, deletion or more than one surface, add **Invariants** and a **Test matrix**. Ask open product questions as three or four multiple-choice questions. Don't guess the answers.

**Done when:** each brief has all six fields and no open product question.

## Step 4. Write a one-page worker card (15 minutes)

Summarize the project's rules for an unattended worker in about 1,200 tokens: safety rules (what it must never do), danger zones, how to run tests, code style, and "if the task is unclear or bigger than the brief, stop and write a handoff". Use no dates, paths or task IDs, so the card stays identical across runs and is cached.

**Done when:** the card is saved and holds nothing that changes between runs.

## Step 5. Run one lean worker per task

Run each task in its own worktree, with a supported cost limit and headroom for the last call. The following is a Bash example for one worker, not the whole pipeline; on Windows, run it in Git Bash. Before running it:

- Save a complete brief at `.pilot/briefs/task-1.md` and a worker card at `.pilot/worker-card.md` in the repository root.
- Add `.pilot/` to the repository's ignore rules.
- Deliberately choose the base commit. The worktree inherits the chosen commit; uncommitted project configuration does not carry across.
- Set a worker limit only within an already authorized total budget. The example uses $1.50.

Run it from the repository root. The check before the worker spends nothing, and it stops if a file is missing.

```bash
pilot_root="$(git rev-parse --show-toplevel)/.pilot"
base="$(git rev-parse HEAD)"   # or the commit you chose on purpose
mkdir -p "$pilot_root/results"
echo '{"mcpServers":{}}' > "$pilot_root/empty-mcp.json"

# Check before spending: the brief and the card exist and are not empty.
missing=0
for f in briefs/task-1.md worker-card.md; do
  [ -s "$pilot_root/$f" ] || { echo "Missing $pilot_root/$f"; missing=1; }
done

if [ "$missing" = 0 ]; then
  git worktree add ../pilot-1 -b pilot/task-1 "$base"
  cd ../pilot-1
  FORCE_PROMPT_CACHING_5M=1 claude -p "$(cat "$pilot_root/briefs/task-1.md")" \
    --model sonnet \
    --max-budget-usd 1.50 \
    --output-format json \
    --strict-mcp-config --mcp-config "$pilot_root/empty-mcp.json" \
    --setting-sources local \
    --tools "Read,Grep,Glob,Edit,Write,Bash" \
    --disable-slash-commands \
    --system-prompt "$(cat "$pilot_root/worker-card.md")" \
    > "$pilot_root/results/task-1.json"
fi
```

For tasks 2 and 3, change `task-1` and `pilot-1` in the paths, the branch and the worktree name. The result JSON lands in `.pilot/results/`, outside the worker's worktree.

**Done when:** each task has its own branch and a result JSON, and the total is still inside the approved budget.

Notes for you, the AI:

- Check `claude --help` on the installed version first; flag names can change. Use a recent CLI. Older versions charged for each resume.
- Headless runs need permission to edit and to run the test command without prompting. Grant the narrowest rule that works (for example, the test and git commands only), using the person's existing permission settings. Don't grant broad shell access without asking.
- Reading or creating `.pilot` files and worktrees is local setup. The `claude -p` command consumes usage; run it only within the approved budget. Choose a unique branch and worktree for each task, and inspect the result rather than automatically retrying a failed run.
- Treat a time limit as a different control from a dollar limit. Record any unpriced provider usage as unknown, not zero.
- The equivalent idea works with other tools: one task per process, minimal tools, no extra servers, a fixed short system prompt, a dollar or time cap.

## Step 6. Review each result, once and deeply

For each branch, review the whole diff against the brief's acceptance checks. List every finding first, then recommend one of three: ready for the person's integration decision, one full fix with all findings, or stop. Do not merge during this pilot.

A good reviewer setup is another lean, read-only run with only Read, Grep and Glob, given the diff, the brief and the acceptance list.

**Done when:** each branch has one list of findings and one recommendation.

## Step 7. Report

| Task | Cost | Model calls | Acceptance met | Stopped and why | Review verdict | Baseline |
|---|---|---|---|---|---|---|

Record all preparation, worker, review and retry costs, including stops, plus human minutes. Read cost and turns from each run's JSON output; keep provider valuations separate from actual charges. Do not report a worker-only value as total task cost. Then answer for the person:

1. What did a task cost, compared with the baseline?
2. Did the workers meet the acceptance checks without help?
3. Where did a brief have a gap? A stop caused by a gap is a useful result.
4. Which of the playbook's seven practices would pay off first for this team?

Don't extrapolate three tasks into a productivity multiplier. Say what was measured.

**Done when:** the table has a row for every task, stops included, and the four questions are answered.

## After the pilot

If the person wants to go further, the next steps are a queue of ready tasks, a separate review stage and shared team memory. The author's full runner (prep, worker, review, pipeline, queue, landing gate and hooks) isn't public; the person can ask for a copy at https://calendar.app.google/UVoMSwMPxo1ypDkH9.
