AI Review and Providers
On this page
Pick a provider first, then use AI to review changes, explain code and commits, and write commit messages. AI actions stay hidden until a provider other than None is selected in Settings → AI Provider.
Choosing a Provider
Open Settings → AI Provider and pick a Provider:
- None - AI is off and AI actions are hidden. Everything else works.
- Claude, ChatGPT, Gemini, Copilot - Hosted models through your own API key (see API Key Providers).
- Claude Code, Codex, OpenCode - The coding agent installed on your device, with its own sign-in; no API key (see Coding Agents).
- Custom - Any OpenAI-compatible endpoint, such as Ollama, LM Studio, AWS Bedrock, or Azure OpenAI (see Custom Provider).
- Local - A model Critiq downloads and runs on your device; nothing leaves your machine (see Local Models).
Each provider remembers its own API key and model, so you can switch between providers without re-entering them. The same page sets the Commit message style and the AI review effort for whichever provider is active. The status bar shows the active provider.
Coding Agents: Claude Code, Codex, and OpenCode
If you use Claude Code, the Codex CLI, or OpenCode, select Claude Code, Codex, or OpenCode in Settings → AI Provider. Critiq uses the agent installed on your device and its existing sign-in, so no API key is needed. Install the agent and sign in first:
- Claude Code - run
claudeand sign in. - Codex - run
codex login. -
OpenCode - run
opencode auth loginand sign in to the providers you want to use. Critiq uses OpenCode's providers and models, so this is also a way to review with any model OpenCode supports.
The Model dropdown lists the models your installed agent offers, which depend on your plan and the agent's version. Default lets the agent choose, so you automatically get its recommended model.
- Checks its own findings - The agent can read and search files in the repository, so before reporting a problem that depends on a caller, a definition, or a test, it reads that code to confirm it.
-
Read-only - The agent cannot edit files, run commands that change anything, or
use the network. Reading is limited to the repository, and credential files such as
.envand private keys stay unreadable. This is enforced by the agent's own permission system and sandbox, not just by instructions. OpenCode can read files but not search file contents. - A fresh context every time - Each review, commit message, or explanation starts a new agent session that is closed when it finishes, so different reviews and pull requests never share context.
- Live progress - While a review runs, the status bar shows what the agent is doing, such as which file it is reading.
The agent's own settings, memory, and MCP servers are not used for Critiq's requests; for OpenCode, the repository's own OpenCode configuration is not loaded either. Usage counts against your Claude or ChatGPT plan, or the providers you signed in to in OpenCode, like using the agent directly.
API Key Providers: Claude, ChatGPT, Gemini, and Copilot
Select the provider, paste an API key into API Key, and pick a Model. Requests go straight from Critiq to that provider and are billed to your account with them.
- Claude - An Anthropic API key from the Claude Console. Default model: Claude Sonnet 4.6.
- ChatGPT - An OpenAI API key from the OpenAI platform. Default model: GPT-5.4. A ChatGPT subscription is not an API key; to use a ChatGPT plan, use Codex instead.
- Gemini - A Gemini API key from Google AI Studio. Default model: Gemini 2.5 Flash.
- Copilot - A GitHub personal access token with access to GitHub Models. Default model: OpenAI GPT-5. Other models GitHub Models offers, including Anthropic and Meta models, are in the list.
The Model list marks the recommended model for each provider. Older models stay in the list marked Legacy or with a pinned date, so a model you already chose keeps working.
API keys are stored on your device, encrypted with your operating system's credential protection (Keychain on macOS, DPAPI on Windows, the Secret Service keyring on Linux). They are only sent to the provider they belong to.
Local Models
Local models run entirely on your device: no account, no API key, and your code never leaves your machine. Select Local in Settings → AI Provider, choose a model, and Critiq downloads it once (from Hugging Face) along with the runtime that runs it.
| Model | Download | License |
|---|---|---|
| Qwen2.5 Coder 7B (default) | ~4.9 GB | Qwen License |
| Qwen3.5 9B Instruct | ~5.9 GB | Apache 2.0 |
| Qwen3.5 4B Instruct | ~3.0 GB | Apache 2.0 |
| Gemma 4 E4B Instruct | ~5.4 GB | Apache 2.0 |
| Gemma 4 E2B Instruct | ~3.5 GB | Apache 2.0 |
- Each model's description in Settings links to its license; make sure your use complies with it.
- Context Size sets how many tokens the model sees at once (default 4096). Higher values let it see more code per request but use more memory.
- Open models folder shows where models are stored, and Delete downloaded model frees the disk space.
- For a larger model than these, run it in Ollama or LM Studio and connect it with the Custom provider.
Local models are slower and smaller than hosted models, so AI review adapts:
- Groups of more than two files are reviewed one file at a time, with the other files shown as related changes.
- When the context window is small, each checklist is shortened to its most important checks before any code context is dropped.
- Very large changes are split into smaller reviews so every file is still covered.
Suggest commits is not available with built-in local models: grouping changes into commits needs the whole change set at once, which does not fit in their context window. A custom endpoint running a larger model works.
Custom Provider (OpenAI-Compatible APIs)
The Custom provider works with any API that accepts OpenAI-compatible chat completion requests. This includes services like AWS Bedrock, Azure OpenAI, Ollama, LM Studio, and self-hosted endpoints.
How It Works
When you select the Custom provider, Critiq sends requests to your specified endpoint using
standard OpenAI chat completion format with Bearer {apiKey} authentication.
Configuration
- Go to Settings → AI Provider
- Select Custom as the provider
- Enter your API Key (used as Bearer token; leave it empty if your endpoint does not need one)
-
Enter the Custom Endpoint URL. Critiq posts to this URL exactly as written, so
use the full chat completions URL ending in
/chat/completions, not just the base/v1URL. - Enter your Model name exactly as the API expects it
Custom endpoints support every AI feature, including Suggest commits, as long as the model's context window is large enough for the change set.
Example: AWS Bedrock
AWS Bedrock supports an OpenAI-compatible API. To use it with Critiq:
- API Key: Your Amazon Bedrock API key (generate in AWS Console → Bedrock → API keys)
-
Endpoint:
https://bedrock-runtime.{region}.amazonaws.com/openai/v1/chat/completions -
Model:
anthropic.claude-3-5-sonnet-20241022-v2:0(or other Bedrock model ID)
Replace {region} with your AWS region (e.g., us-east-1,
us-west-2).
Example: Local Models (Ollama, LM Studio)
- API Key: Leave empty or use any placeholder
-
Endpoint:
http://localhost:11434/v1/chat/completions(Ollama) orhttp://localhost:1234/v1/chat/completions(LM Studio) -
Model: The model name as your server lists it (e.g.
qwen2.5-coder:14bin Ollama; runollama listto see yours)
Example: Azure OpenAI
- API Key: Your Azure OpenAI API key
-
Endpoint:
https://{resource}.openai.azure.com/openai/deployments/{deployment}/chat/completions?api-version=2024-02-01 - Model: Your deployment name
What AI Can Do
With a provider selected, these actions appear across Critiq:
- Explain this change, Suggest improvements, Find potential bugs - Right-click code in a diff. Answers appear in the AI Assistant panel in the right sidebar.
- Generate a commit message - The wand button in the Commit drawer writes a message from your staged changes, in your commit message style.
- Explain commit - Right-click a commit in the graph (see Commit Graph Actions).
- Suggest commits - Group changes into commits in the Commit Composer (see Suggest commits with AI).
- Triage and AI Review - Classify risk per file and get inline review comments on comparisons and pull requests (below).
AI Review
Critiq's AI Review analyzes your code changes with full context awareness. Instead of reviewing diffs in isolation, the AI understands the surrounding codebase, including callers, dependencies, and related tests, to provide more accurate and actionable feedback.
When you request an AI review, Critiq builds rich context for each changed symbol using a combination of static analysis and language intelligence:
- Symbol boundaries - Tree-sitter parsing identifies exact function, class, and method boundaries so reviews focus on complete logical units rather than arbitrary line ranges.
- Caller discovery - LSP integration finds references to changed code across your codebase, helping the AI understand the blast radius of modifications.
- Definitions the change uses - Critiq includes the current definitions of the functions and types the changed code calls, so the AI can check that arguments and return values still match.
- Test coverage - Critiq locates test files that exercise changed code, giving the AI visibility into existing test coverage.
This context is compiled once and cached per comparison, so triage and detailed review share the same analysis without redundant computation.
A full review of a comparison or pull request then:
- Reviews related files together - A file and its tests, translations of the same resource, and files that call each other are reviewed as a group, so mismatches between them are caught.
-
Uses a checklist per language - Each file gets a checklist for its language or
file type (for example TypeScript, Go, Dockerfiles, GitHub workflows, or
package.json), listing the problems worth looking for and the ones not to report. - Places comments accurately - Each comment lands on the lines of code it quotes, not on a line number the model guessed.
- Filters false positives - At medium and high effort, duplicate comments are merged and a fact-check removes comments the diff proves wrong, such as a recommendation the change already made.
When the review finishes, a notification summarizes the comments and lists any files that were skipped.
Risk Levels
Before detailed review, AI triage classifies each change by risk level to help you prioritize review effort:
- Critical - Security-sensitive changes, authentication modifications, or high-impact business logic affecting many callers.
- Needs Review - Significant logic changes, API modifications, or code affecting external integrations.
- Minor - Small improvements, refactoring, or changes with limited scope.
- Low Impact - Documentation, formatting, or trivial modifications.
Triage decisions factor in caller count and test coverage. Changes affecting many callers or lacking test coverage trend toward higher priority.
Configuration
After selecting an AI provider in Settings → AI Provider, choose how review should run:
- Manual triage - Right-click any file and choose Triage File to classify changes on demand.
- Full review - Request detailed AI review from the file context menu or review panel for in-depth analysis with inline comments.
- AI review effort - Choose how thorough full reviews are. See Review Effort below.
- Auto-triage - See Auto-triage files below for the automatic classification workflow and defaults.
- Commit message style - Choose neutral, developer, feature, or conventional framing for generated commit messages.
Auto-triage files
In Settings → Features → Code Review, enable Auto-triage files to automatically analyze all files when loading a comparison or PR. Results appear in the triage panel as they complete. This requires an AI provider to be configured.
Auto-triage is disabled by default. This setting only controls automatic runs; manual triage from Triage File remains available.
Review Effort
In Settings → AI Provider, choose an AI review effort:
- Low (fastest) - One review pass per group of files.
- Medium (recommended) - Up to two passes, the second looking for problems the first missed, plus duplicate merging and the fact-check.
- High (most thorough) - Up to three passes.
Later passes stop early when one finds nothing new. Higher effort takes longer, especially with local models.
What Is Sent to the Model
-
Never sent - Credential files (such as
.envfiles, private keys, cloud credentials, and Terraform state) and binary files. - Skipped by default - Lockfiles, vendored dependencies, build output, generated code, test fixture data, very large files, and deleted files.
- Everything else - The changed code and its context. With a hosted provider or a coding agent this goes to that provider; with a local model it never leaves your device.
You can bring back skipped categories, or exclude more files, with project rules. Credential files and binaries are never sent, whatever the rules say.
Project Rules
Add a .critiq/rules.json file at the root of a repository to tune AI review for that
project:
{
"include": ["src/generated/**"],
"exclude": ["legacy/**"],
"rules": [
{ "path": "src/api/**/*.ts", "rule": "Handlers must validate request bodies before use." },
{ "path": "**/*", "rule": "Flag hardcoded secrets.", "mergeSystemRule": true }
]
}
-
include- Files to review even though they would be skipped by default (for example generated code you maintain by hand). exclude- Files that are never reviewed.-
rules- Your own review instructions. For each file, the first entry whosepathmatches applies. It replaces Critiq's built-in checklist for that file, unlessmergeSystemRuleistrue, in which case both apply.
Paths are glob patterns supporting *, **, ?, and
{a,b}, matched case-insensitively. Commit the file so everyone reviewing the project
gets the same rules.