project-brain logoproject-brain

Diff Commands

brain diff explain

Generates an explanation for a specific file or function using the local semantic graph and optional LLM.

brain diff explain <target>

Target syntax

brain diff explain src/api.py                  # explain entire file
brain diff explain src/api.py:create_user      # explain specific function

Output depends on LLM config

Without LLM (provider: none)

Structural summary — function list, class list, import graph, size metrics.

With LLM configured

Semantic explanation — what the code does, risks, logic overview, behavioral impact.

Tip

Results are cached in .brain/cache/ — re-running on unchanged functions returns instantly without LLM calls.