For AI agents: the complete documentation index is available at https://docs.gage.io/llms.txt, the full documentation bundle is available at https://docs.gage.io/llms-full.txt, and this page is available as Markdown at https://docs.gage.io/scanners/code-review.md.

code-review

The scanner reviews the code a session wrote or changed for defects. Defects include project rule violations, best-practice violations, poor stack alignment, and bugs the session did not detect. Each finding names the violated project rule and describes the defect concretely enough to check against current project content. Defects the session itself diagnosed and fixed are skipped.

How it works

The scanner runs three tasks.

The attach_project_files task adds two attachments per project that appears in the scan: project-rule-files holds the project’s rule files, such as memory files, settings, skills, commands, and agent definitions, and project-stack-files holds its manifest files. Each attachment targets the sessions from that project.

The summarize_projects task summarizes each project. One agent call per project reads the attached files and writes summary notes. When a project’s files have not changed since the last run, the existing summary carries forward without a new agent call. A project with no rule or manifest files is skipped.

The scan_sessions task reviews each session that edited files. Sessions with no file edits are skipped. A review agent reads the session, informed by the project’s summary notes, and writes one finding note per defect. A session that has grown since the last scan is reviewed only over its new lines.

What it writes

The scanner writes notes that are in turn used by downstream issue writers. In particular, findings reads code-review[finding] notes and reports issues from them.

NoteDescriptionTarget
rules[project-summary]Summarizes project rulesAttachment
stack[project-summary]Summarizes a project stack and architectureAttachment
code-review[finding]Code quality findingSession

Running

The scanner is in the default group. It runs when you run gage scan without selecting scanners. To run it explicitly:

gage scan -s code-review