NIPA AIR Logo Running AI Reviews Locally

Review Prompts

The AI reviews on netdev (BPF and some other subsystems) use LLM review prompts developed by Chris Mason:

github.com/masoncl/review-prompts

Clone this repository to get the latest prompts, and ask your favorite LLM to use them to review your code.

Review Modes

There are two modes for running reviews:

Classic Mode

The original single-prompt mode. Works well for small to medium patches.

Current directory is the root of a Linux Kernel git repository. Read the prompt from kernel/review-core.md. Using the prompt, do a deep dive regression analysis of the HEAD commit. Use commit range <base>..<head> for the false-positive-guide.md section.

Orc Mode (Recommended for Large Patches)

The newer agent-based mode that breaks the review into individual tasks. This mode is recommended for large diffs because it:

To use orc mode, first run the preprocessing script:

cd /path/to/linux
kernel/scripts/create_changes.py HEAD

Then invoke the LLM with the orc prompt:

Current directory is the root of a Linux Kernel git repository. Read the prompt from kernel/agent/orc.md and run it on the HEAD commit.
When to use Orc Mode

Use orc mode for patches with large diffs, multiple files, or complex changes. The preprocessing step extracts context that helps the LLM focus on relevant code without spending tokens discovering it on its own.

Where <base>..<head> should be replaced by a real git commit hash range (classic mode only).

Output Format

The review-prompt instructs the LLM to write its findings to a file called review-inline.txt in the repository root. This file contains the regression analysis formatted for email replies.

MCP Tools

Chris has also developed a MCP integration which indexes commits and the code to make the LLMs burn fewer tokens fetching context. (semcode)

See the README of the review prompt repo for more information.

Getting Help

This page is very rudimentary. For any questions and comments please reply to a thread on the mailing list which brought you here and CC Chris Mason <clm@meta.com>.