# Reviews that follow your team's conventions

Write rules in plain English, keep them next to the code they govern, and let MergeHarbor learn from how your team responds to its comments. You can see and undo what it learns.

[Start free trial](https://app.mergeharbor.com/signup) [Read the docs](https://mergeharbor.com/docs/rules)

services/payments/.mergeharbor/config.yml

```
tier: deep
min_severity: major
categories: [security, correctness, data_integrity]
instructions: Amounts are integers in cents.
rules:
  - Every charge takes an idempotency key.
  - rule: Use the ledger package for balance changes
    paths: ["**/*.go"]
    severity: major
context: [docs/ledger.md]
```

## How it works

1.  ### Write your rules

    Add rules in the console, in .mergeharbor/ folders in the repository, or by commenting @mergeharbor remember on a pull request.

2.  ### Let it learn

    MergeHarbor records which comments get fixed, reactions, dismissals, replies and the points your own reviewers keep raising.

3.  ### Approve what it proposes

    Patterns become proposed rules, with the evidence, for an administrator to approve or decline. Nothing learned from feedback applies on its own.

## What you get

Rules that live with the code

A .mergeharbor/ folder can sit in any directory and applies to everything below it. The closest folder to a file wins.

Changes through pull requests

Configuration is read from the merge base, so a pull request cannot change its own review. New rules apply once they merge.

Replies become rules

A reply that explains a convention, such as "we do this on purpose because…", becomes a proposed rule scoped to that folder.

Less of what you pass over

Kinds of comments your team keeps leaving unchanged are held back in that repository or folder. Security and correctness findings never are.

See which rules earn their place

For each rule, see how many comments it produced and the share of those on merged pull requests that later code fixed.

Bring your existing setup

mh import converts configuration left by another AI code reviewer into .mergeharbor/ folders, and lists anything it cannot convert.

Documentation: [Rules and learning](https://mergeharbor.com/docs/rules) [Learning and review quality](https://mergeharbor.com/docs/learning) [Repository configuration](https://mergeharbor.com/docs/repository-config)

## Frequently asked questions

Can one comment change how MergeHarbor reviews?

No. Rules learned from feedback start as proposed and need an administrator's approval. They are only suggested once an organization has about ten reviewed pull requests in the last month.

How do I undo something it learned?

Insights → Quality lists every learned preference with the evidence behind it. Undo brings the comments back right away, and both actions are recorded in the audit log.

Do console rules and repository rules conflict?

Both apply. Memory → Custom rules lists rules from every source together, each labelled Console or Repository file.

Have another question? [Ask our support team](https://mergeharbor.com/contact?topic=support)

## Explore other features

### Codebase-aware review

Reviews that read your codebase, not just the diff

[Codebase-aware review](https://mergeharbor.com/features/review-agent)

### Context connectors

Tickets, docs and production errors in reviews

[Context connectors](https://mergeharbor.com/features/context)

### CLI and local reviews

Review your changes before you push

[CLI and local reviews](https://mergeharbor.com/features/cli)

## Review every pull request with the context of your whole codebase

Connect a code host in minutes. Reviews start right away, and codebase context is added as indexing completes.

[Start free trial](https://app.mergeharbor.com/signup) [Book a demo](https://mergeharbor.com/contact?topic=sales&source=demo)
