project-brain logoproject-brain

Diff Commands

brain diff review

Generates semantic diff explanations using your configured LLM provider, then opens an interactive HTML report.

brain diff review [from_ref] [to_ref]
ArgumentTypeDefaultDescription
from_refstringHEAD~1Source Git reference
to_refstringHEADTarget Git reference

Workflow

  1. 01Validates Git refs
  2. 02Computes diff (same as diff show)
  3. 03Extracts changed Python functions
  4. 04Builds prompts per function
  5. 05Calls configured LLM provider
  6. 06Caches results in .brain/cache/
  7. 07Writes JSON + HTML reports
  8. 08Opens HTML report in browser

Output files

.brain/reports/diff_2026-05-14_10-30.json
.brain/reports/diff_2026-05-14_10-30.html   ← opens automatically

The HTML report is interactive and includes grouped files, risk labels (low/medium/high), semantic summaries, and impact descriptions.

Note

When provider: none in brain.yaml, review falls back to heuristic structural summaries — no LLM required.