codeant review command runs an AI-powered code review using an agentic architecture. The agent analyzes your code changes, reads surrounding context from your codebase, and provides detailed suggestions with severity levels.
Basic Usage
Options
Review Scope
| Option | Description |
|---|---|
--all | Review committed + uncommitted changes (default) |
--committed | Review only unpushed commits |
--uncommitted | Review only uncommitted changes |
--staged | Review only staged files |
--last-commit | Review the last commit |
--last-n-commits <n> | Review the last n commits (max 5) |
--base <branch> | Compare against a specific base branch |
--base-commit <commit> | Compare against a specific commit SHA |
Filtering & Thresholds
| Option | Description |
|---|---|
--fail-on <level> | Fail threshold: BLOCKER, CRITICAL, MAJOR, MINOR, INFO (default: CRITICAL) |
--include <patterns> | Comma-separated glob patterns to include files |
--exclude <patterns> | Comma-separated glob patterns to exclude files |
How It Works
The review runs in a multi-phase pipeline:Phase 1: Per-File Analysis
Each changed file is analyzed independently and in parallel. For each file, the agent:- Receives the diff and full file content
- Can use tools to read other files, search the codebase, and explore directory structures
- Iterates through up to 5 conversation turns to gather context and form suggestions
- Returns file-specific suggestions with severity labels
| Tool | Description |
|---|---|
| Read | Read file contents with optional line ranges |
| Glob | Find files matching glob patterns |
| Grep | Search file contents with regex patterns |
| LS | List directory contents |
Phase 2: Reflector
After all per-file analyses complete, the reflector phase:- Combines all per-file suggestions
- Runs a final analysis pass to deduplicate, refine, and prioritize
- Produces the final set of code suggestions
Severity Levels
Each suggestion is assigned a severity based on its label:| Label | Severity |
|---|---|
security | CRITICAL |
bug | MAJOR |
performance | MAJOR |
maintainability | MINOR |
code quality | MINOR |
best practice | MINOR |
--fail-on flag determines the exit code:
0— No suggestions at or above the threshold1— Suggestions found at or above the threshold
File Filtering
The review automatically excludes files that are unlikely to benefit from code review: Lock files:package-lock.json, yarn.lock, pnpm-lock.yaml, composer.lock, Gemfile.lock, Cargo.lock, poetry.lock, Pipfile.lock, go.sum
Binary/compiled: .exe, .dll, .so, .dylib, .bin, .o, .a, .class, .pyc, .wasm, .jar, .war
Media: .png, .jpg, .jpeg, .gif, .svg, .webp, .mp3, .mp4, .wav, .avi, .mov
Fonts: .woff, .woff2, .ttf, .eot, .otf
Archives: .zip, .tar, .gz, .bz2, .7z, .rar
Generated/minified: .min.js, .min.css, .map, .pb
Documents: .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx
System: .DS_Store, Thumbs.db
Size Limits
- Maximum file size: 5,000 lines per file
- Maximum files per review: 10 unique files
Examples
Terminal UI
The review displays a live progress indicator in your terminal:- Init — Initializing review session
- Fetch — Gathering diffs and file contents
- Analyze — Per-file agent analysis (parallel)
- Reflect — Final reflector pass