Skip to main content
This feature is in pre-early access and internal testing and requires enabling directly from CodeRabbit.
Custom recipes let you encode your team’s repeated finishing-touch tasks — things like enforcing import ordering, tightening TypeScript types, or applying project-specific conventions — into named, reusable instructions. Once defined, anyone on your team can trigger a recipe with a single comment or checkbox click, and CodeRabbit’s agent will carry out the work inside a sandbox and open a PR with the result.

How it works

1

Define recipes in your config

Add up to 5 named recipes under reviews.finishing_touches.custom in .coderabbit.yaml. Each recipe has a name and a freeform instructions field.
2

Trigger a recipe

Comment @coderabbitai run <recipe name> in any PR, or check the corresponding recipe checkbox in the CodeRabbit Walkthrough under ✨ Finishing Touches.
3

Agent execution

CodeRabbit clones your repository into a sandbox, provides the agent with full PR context (title, description, summary, coding guidelines), and runs your instructions using the Claude Agent SDK.
4

Receive the output

By default, CodeRabbit opens a new pull request against your branch containing the agent’s changes. You review and merge it like any other PR.

Configuration

Add custom recipes to .coderabbit.yaml:
reviews:
  finishing_touches:
    custom:
      - name: "cleanup stale imports"
        instructions: |
          Scan the changed files for unused imports and remove them.
          Preserve imports used in type positions.
          Do not reorder existing imports; only remove stale ones.

      - name: "tighten types"
        instructions: |
          Replace `any` types in the changed files with the most specific
          TypeScript type that is correct given the surrounding context.
          Add explicit return types to exported functions that are missing them.

      - name: "enforce error handling"
        instructions: |
          Audit all async functions in the changed files.
          Ensure every awaited call is wrapped in try/catch or has a .catch() handler.
          Use the project's existing error logger pattern when catching errors.

Recipe fields

FieldRequiredLimitsDescription
nameYesMax 100 charactersIdentifier used in run commands. Case-insensitive. Must be unique across your recipes.
instructionsYesMax 10,000 charactersFreeform description of what the agent should do. The agent receives full PR context alongside these instructions.
enabledNo—Set to false to temporarily disable a recipe without removing it. Defaults to true.
You can define up to 5 custom recipes per repository. Recipe names are matched case-insensitively, so "Cleanup Stale Imports" and "cleanup stale imports" refer to the same recipe.

Triggering recipes

PR comment

@coderabbitai run cleanup stale imports
Recipe names can include spaces. Quoting is optional:
@coderabbitai run "tighten types"
The command is matched case-insensitively and can appear anywhere in a comment, including multi-line comments.

Ad hoc evaluation (without a saved recipe)

To try out a finishing touch without committing it to your config, use the evaluate command directly in a PR comment:
@coderabbitai evaluate custom finishing touch --name <name> --instructions <text>
For example:
@coderabbitai evaluate custom finishing touch --name "sort imports" --instructions "Sort all import statements alphabetically within each import group in the changed files."
The agent runs exactly as it would for a saved recipe — with full PR context — but the recipe is not persisted anywhere. This is useful for one-off tasks or for iterating on instructions before adding them to .coderabbit.yaml.

Finishing Touches checkbox

Each enabled recipe appears as a checkbox in the ✨ Finishing Touches section of the CodeRabbit Walkthrough comment. Checking it triggers the recipe with the Create PR output mode.

What the agent receives

When a recipe runs, CodeRabbit provides the agent with:
  • Your recipe instructions
  • PR title and description
  • CodeRabbit’s PR summary (walkthrough and objectives)
  • Global coding guidelines from reviews.path_instructions in your config
  • Full repository access via Read, Write, Edit, Glob, Grep, and Bash tools
This means your recipes can reference project conventions, coding standards, and PR intent without you needing to repeat that context in every recipe.

Requirements

Plan

Pro plan required

Platform

GitHub only (GitLab and Bitbucket coming soon)

Early access

early_access: true must be set in .coderabbit.yaml

Pull requests only

Recipes run on pull requests, not issues or commits
Enable early access in your config:
early_access: true

reviews:
  finishing_touches:
    custom:
      - name: "your recipe"
        instructions: "..."

Example recipes

Remove console statements:
- name: "remove console logs"
  instructions: |
    Find and remove all console.log, console.warn, and console.error calls
    from the changed files. Leave intentional logging that uses the project's
    logger utility (e.g. logger.info, logger.error) untouched.
Add missing test coverage:
- name: "add edge case tests"
  instructions: |
    Review the changed source files and identify edge cases not covered
    by the existing tests. Add focused unit tests for those cases using
    the project's existing test framework and patterns.
Enforce naming conventions:
- name: "fix naming conventions"
  instructions: |
    Check the changed files for variables, functions, or classes that
    do not follow the project's naming conventions (camelCase for variables
    and functions, PascalCase for classes and interfaces). Rename where needed
    and update all references in the same files.