Advanced Features
Take your code reviews to the next level with these powerful tools.
Agentic Multi-Step Reviews
Go beyond single-pass reviews with a 5-step AI pipeline:
- Analyze Diff: Classify changes and line counts.
- Gather Context: Resolve imports and related tests.
- Pattern Analysis: Identify codebase conventions.
- Deep Review: Comprehensive analysis with full context.
- Synthesis: Self-critique to remove false positives.
Agentic Workspace Editing
When using agentic models (like Claude 3.7 Sonnet or v0), the AI can autonomously create, update, or delete files in your workspace to implement suggested changes.
- Safety First: A confirmation dialog appears in VS Code before any file modification. You can review the path and action before approving.
- Manual Control: Every code block in the chat history features a Create button to manually save snippets to files.
Agent Skills
Enhance your code reviews by applying specialized "skills" (e.g., "Security Auditor," "Performance Expert").
- Library: Download skills from GitHub (default:
vercel-labs/agent-skills). - Multi-Skill Selection: You can select and apply multiple skills simultaneously to a single review.
- Workflow: Use
Browse Agent Skillsto download andApply Skills to Reviewto select which ones to use.
Architecture Diagrams
Generate visual Mermaid.js diagrams from your code changes.
- Trigger: Click the 📊 Diagram button in the review panel.
- Types: Class diagrams, flowcharts, sequence diagrams, and dependency graphs.
Model Recommendations (Auto-Select)
Never worry about picking the right model again. The extension can automatically switch to the best model for each task.
- How it works: When
ollama-code-review.autoSelectModelis enabled, the recommendation engine scores all configured models based on the task type (review, commit message), languages in the diff, and the diff's size. - Smart Logic: It favors coding-specific models (like
qwen2.5-coder) for reviews and lighter models for simple commit messages.
Semantic Version Bump Advisor
Instantly determine the right semantic version bump for your next release.
- Command:
Ollama Code Review: Suggest Version Bump. - Logic: The AI analyzes your changes for breaking changes (MAJOR), new features (MINOR), or bug fixes (PATCH).
- Auto-Update: If a
package.jsonis found, you can apply the version change directly.
Contentstack Schema Validation
Validate Contentstack CMS field names used in your source code against actual Content Type schemas.
- How it works: The extension fetches schemas from the Contentstack API or a local JSON export and flags mismatched field names.
- Suggestions: Provides Levenshtein-distance-based spelling suggestions for mismatched fields.
Scan for Secrets
Detect accidentally committed secrets (API keys, tokens, passwords, private keys) in your staged changes or files before they reach your repository.
- Command:
Ollama Code Review: Scan for Secrets. - Logic: Uses regex pattern detection combined with Shannon entropy filtering to suppress false positives.
Impact Analysis & API Guard
Analyze the downstream impact of your changes before you commit.
- API Change Detection: Detects changes to function signatures, exported constants, and interface definitions.
- Downstream Impact Graph: Visualizes which files and modules depend on the modified code.
- API Guard: Status bar alerts and notifications when high-impact API changes are detected.
Smart Context
When the AI reviews a file, it doesn't just see the raw diff — it also sees the surrounding business logic through a call-graph-aware context builder.
How It Works
- Changed lines are detected from the git diff (or the saved file for Auto-Review on Save).
- Enclosing functions are located using VS Code's language server.
- Call graph is BFS-expanded up to a configurable depth.
- Relevant imports from the changed file are collected.
Commands Using Smart Context
The same logic powers several convenient commands:
- Explain File with Imports: Understand a complex file in the context of its dependencies.
- Copy File/Function with Imports: Perfect for pasting self-contained snippets into external LLMs with all necessary context included.
Auto-Review Context (Fixed Limits)
When used during Auto-Review on Save, the smart context applies conservative hardcoded limits to keep latency low:
| Limit | Value |
|---|---|
| Max BFS depth | 2 |
| Max functions collected | 8 |
| Max characters per function | 1,500 |
| Total character budget | 6,000 |
Copy Function with Imports (Configurable)
When used by the Copy Function with Imports command, limits are configurable via settings:
| Setting | Default | Description |
|---|---|---|
copyFunction.maxDepth | 3 | How many levels deep to follow calls |
copyFunction.maxFunctions | 15 | Max total functions to collect |
copyFunction.maxCharsPerFunction | 8000 | Max characters per function body |
copyFunction.characterBudget | 64000 | Total character budget for all functions |
copyWithImports.noLimits | false | Remove all limits (use with care on large files) |
Monorepo Support
Ollama Code Review features deep awareness of monorepo architectures (Lerna, pnpm, Nx, Yarn Workspaces).
- Local Package Resolution: When gathering context, the extension correctly identifies imports that point to other packages within the same monorepo, even when they appear in
node_modules. - Workspace-Wide Intelligence: Review findings and agentic steps take into account the relationships between packages, providing better context for shared utilities or internal APIs.
Team Knowledge Base
Encode your team's architecture decisions, coding patterns, and review rules in a .ollama-review-knowledge.yaml file.
- ADRs: Document Architecture Decision Records so the AI can flag code that deviates from them.
- Patterns: Define reusable code patterns (with examples) for the AI to enforce.
- Auto-Discovery: Relevant knowledge entries are matched against your diff and injected into the review prompt automatically.
- Citations: The AI cites specific entry IDs (e.g.,
ADR-001) when flagging violations.
RAG-Enhanced Reviews (Retrieval-Augmented Generation)
Boost review quality by automatically retrieving similar code from your indexed codebase and injecting it as additional context.
- Semantic Search: Uses vector embeddings to find code that is logically similar to your changes, even if keywords don't match exactly.
- Command:
Ollama Code Review: Index Codebaseto build the local vector index. - Privacy: All indexing and retrieval happen locally (uses Ollama's
nomic-embed-textby default).
Reliability & Precision
Ollama Code Review uses several techniques to ensure that AI-generated feedback is accurate and correctly placed.
Structured Review Schema
The extension requests reviews in a strictly defined JSON schema. This allows it to reliably parse findings, severities, and suggested code blocks without being confused by the model's conversational filler.
Smart Anchor Validation
One of the biggest challenges with AI reviews is "hallucinated" line numbers. Our Anchor Validation engine checks every AI suggestion against the actual file content:
- Exact Match: Verifies the suggested "original code" exists in the target file.
- Fuzzy Recovery: If a direct match fails, it uses Levenshtein distance to find the closest matching block near the suggested line.
- Auto-Discard: If no reliable anchor can be found, the finding is automatically converted to a file-level comment to prevent misleading UI annotations.
Compliance Profiles
Focus the AI on specific standards:
- Security: OWASP Top 10, NIST CSF.
- Regulatory: GDPR, HIPAA, PCI-DSS, SOC 2.
- General: Performance, Accessibility, Educational, Strict.