Reference

Configuration

Every setting, its default, the file it belongs in, and which one wins. All files are optional: with none, the bot runs on environment variables and the defaults below.

Two config files

Operator config: codereview.yamlRepository config: .codereview.yaml
WhereWherever the bot runs (see lookup order)Committed to the repository, read from the PR's base commit, so a PR can't change its own rules
HoldsModels and keys, code hosts, engine settings, approvals, the command footer, and review.defaults: the review settings every repository starts fromReview settings only
Set byWhoever runs the bot: you, a CI job, or Divmora Code Review ConsoleThe repository's maintainers

${VAR} in either file is replaced with the environment variable VAR. Keep keys and tokens in the environment, never in a file.

Where the operator config comes from

The first one found is used; the others are ignored:

  1. --config <path>
  2. $CODEREVIEW_CONFIG: a path
  3. $CODEREVIEW_CONFIG_YAML: the YAML itself. The console passes each job's config this way; in CI it can live in one protected variable.
  4. ./codereview.yaml or ./codereview.yml in the working directory, for local use

The environment variable comes before the file in the working directory: in GitLab CI and Bitbucket Pipelines that directory is the PR's checkout, and a codereview.yaml added by a PR must not replace the operator's config. Run codereview config validate to see which source was used and whether it is valid.

Which setting wins

A review setting is resolved from lowest to highest:

  1. built-in defaults
  2. review.defaults in the operator config
  3. the repository's .codereview.yaml
  4. CODEREVIEW_OVERRIDES (per-repository settings from the console)
  5. CLI flags, including turning things off: --approve=false, --score-labels=false, --fail-on none

The operator keeps control of a few things:

  • review.approve and review.commands are operator-only. In .codereview.yaml they are ignored, with a warning in the log.
  • A repository's fail_on can set one where the operator has none, and otherwise only make it stricter.
  • A repository's model is used only with allow_repo_model: true, and only names one of the operator's profiles.
  • instructions, path_instructions, path_filters and learnings add up across levels instead of replacing each other.

Operator config

KeyDefaultMeaning
modelthe only profile, if there is oneActive model: a profile name from models or a provider:model spec. --model and CODEREVIEW_MODEL win over it.
fallback[]Models tried in order when the active one fails after its retries. CODEREVIEW_FALLBACK (comma-separated) wins.
models.<name>Named model profiles, with the keys below.
allow_repo_modelfalseLet .codereview.yaml pick one of the profiles with model:. Specs from a repository are never used.
bot_namethe token's user, else codereviewHandle in placeholders and the command footer (@<bot_name> review). Set it for a GitHub App (its slug) or tokens with no user.
reviewEngine settings, approvals and review.defaults.
github.api_url$GITHUB_API_URL, else https://api.github.comGitHub Enterprise Server: https://<host>/api/v3. GITHUB_TOKEN is sent only here.
github.token$GITHUB_TOKENA token that can read the PR and post comments.
github.app_id, private_key_file, private_keyUse a GitHub App instead of a token.
github.hostfrom api_urlPR URL host when it differs from the API host.
gitlab[]one instance from GITLAB_URL / CI_SERVER_URLOne entry per GitLab instance: base_url, token, host, skip_tls_verify (last resort for private CAs).
bitbuckethttps://api.bitbucket.org/2.0Bitbucket Cloud: token (access token), or email + api_token; api_url.

Model profile keys

KeyDefaultMeaning
providerrequiredopenai, anthropic, gemini, bedrock, azure, ollama, openrouter, groq, deepseek, mistral, xai, together, litellm, openai-compatible
modelrequiredThe provider's model or deployment ID.
api_key / api_key_envthe provider's usual variableA key as ${VAR}, or the name of the variable holding it.
base_urlthe provider'sFor Azure, gateways and OpenAI-compatible servers.
headersExtra HTTP headers, e.g. for a gateway.
region, aws_profileAWS default chainBedrock only.
max_tokens8192Output token limit per call.
temperaturethe provider'sSampling temperature.
timeout5mPer call.
max_retries3Retries with backoff; -1 for none.
structured_outputby providerjson_schema, json_object or prompt.

Engine settings (review:)

Operator config only.

KeyDefaultMeaning
concurrency4Parallel model calls per review.
batch_tokens40000Estimated prompt tokens per call.
max_files150PRs with more reviewable files are skipped.
full_file_max_lines800Files up to this size are sent whole for context.
context_lines60Larger files: lines sent around each change.
verifytrueSecond, skeptical pass over the findings (one extra call).
verify_modelthe review modelModel for that pass; --verify-model wins.
verify_can_dropconfidentconfident, minor or all: what the verifier may remove.
verify_can_addfalseLet the verifier add findings it thinks were missed (unverified).
passes1Review each batch 1–3 times and merge the findings.
anchor_scorestrueStart scores from the previous review's; --full rescores.
repo_config_file.codereview.yamlPath of the repository config, read from the base commit.
approve.enabledfalseApprove PRs that pass, with --post. --approve turns it on, --approve=false off, for one run.
approve.blockmajorLowest severity that blocks approval: critical, major, minor, nitpick or none.
approve.min_score0Also need every score at least this high (1–100); 0 ignores scores.
approve.withdrawtrueWithdraw the bot's earlier approval when a later review doesn't pass.
commandsfalseList the @bot chat commands in the summary footer. Only when a webhook service (the console) answers them.
defaultsAny review setting: the starting point for every repository.

Review settings (.codereview.yaml)

These go in a repository's .codereview.yaml or under review.defaults in the operator config.

KeyDefaultFlagMeaning
profilebalanced--profilechill, balanced or assertive.
max_comments25--max-commentsInline comment limit; the rest go in the summary.
min_severityby profile--min-severityDrop findings below critical, major, minor or nitpick.
languageEnglishLanguage of the review text.
poemfalseA short poem in the summary.
instructionsGuidance for the whole review. Adds to the operator's.
path_instructionsList of {path, instructions} for matching files.
path_filtersGlobs to include; !glob excludes. Lockfiles, generated, vendored and binary files are always skipped.
learningsList of {text, path}: team decisions the reviewer follows (at most 100).
guidelines.enabledtrueRead guideline files from the target branch.
guidelines.filesAGENTS.md, CLAUDE.md, .github/copilot-instructions.md, .cursorrulesFiles at the repository root; nested AGENTS.md files are always included.
diagramoff--diagramFlow diagram in the walkthrough: off, auto (when a change spans layers) or always.
labels.modeoff--labelsoff, suggest (a line in the walkthrough) or apply (also set them).
labels.allowPatterns of the project's labels that may be used, e.g. type::*.
labels.suggest_onlyShown, never set, even in apply mode.
labels.max4Labels per PR, at most 10.
labels.instructionsHow to choose labels.
auto_review.enabledtrue--auto applies theseReview on pushes.
auto_review.draftsfalseReview draft PRs.
auto_review.incrementaltrueOn new pushes, review only what changed.
auto_review.base_branchesanyOnly PRs into matching branches.
auto_review.ignore_title_keywords[skip review], [no review], WIPSkip PRs whose title contains one.
high_level_summarytrueAppend a "Summary by codereview" block to the description.
high_level_summary_placeholder@codereview summaryWhere the block goes; works even when the summary is off.
high_level_summary_instructionsHow to write the summary.
auto_title_placeholder@codereviewPut it in the title to get a generated one.
auto_title_instructionsHow to write the title.
score_labelsfalse--score-labelsSet Quality, Security and Maintainability score labels (with --post).
commit_statusfalse--commit-statusSet a codereview status on the commit (with --post).
fail_onnone--fail-onExit 3 at this severity or above. A repository can only make the operator's stricter.
modelOne of the operator's profiles; used only with allow_repo_model.

CODEREVIEW_OVERRIDES

Per-repository settings as JSON, set by Divmora Code Review Console. They win over the repository's file; CLI flags win over them. Unknown keys are rejected.

CODEREVIEW_OVERRIDES
{"profile": "assertive", "max_comments": 30, "min_severity": "minor",
 "model": "claude", "auto_review": true, "drafts": false,
 "instructions": "added to the repository's",
 "diagram": "auto",
 "labels": {"mode": "suggest", "allow": ["type::*"]},
 "learnings": [{"text": "...", "path": "api/**"}]}

Environment variables

VariableMeaning
CODEREVIEW_MODEL, CODEREVIEW_FALLBACKActive model and fallbacks; win over the config.
CODEREVIEW_CONFIG, CODEREVIEW_CONFIG_YAMLOperator config as a path, or the YAML itself (lookup order).
CODEREVIEW_OVERRIDESPer-repository settings as JSON.
CODEREVIEW_STATE_KEYA long random secret, the same on every run: the bot signs what it posts and still recognises its own comments after the token changes user.
GITHUB_TOKEN, GITHUB_API_URLGitHub token and API base; the token is sent only to that host.
GITLAB_TOKEN, GITLAB_URL / CI_SERVER_URLGitLab token (api scope) and instance; the token is sent only to that host.
BITBUCKET_TOKEN, or BITBUCKET_EMAIL + BITBUCKET_API_TOKENBitbucket Cloud credentials.
OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, …Provider keys, read automatically for their provider. Bedrock uses the AWS credential chain.

Full examples: examples/codereview.yaml (operator) and examples/.codereview.yaml (repository).