Hi! š We are doing a big documentation refresh. Help us improve - what's missing or could be better? Let us know! Join the Discord channel or simply send an email!
Define reusable, named recipes that run agentic code changes on your pull requests ā triggered by PR comments or checkboxes in the CodeRabbit Walkthrough.
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.
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.
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.
Identifier used in run commands. Case-insensitive. Must be unique across your recipes.
instructions
Yes
Max 10,000 characters
Freeform description of what the agent should do. The agent receives full PR context alongside these instructions.
enabled
No
ā
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.
@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.
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.
- 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:
Copy
- 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:
Copy
- 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.