|
| 1 | +--- |
| 2 | +title: Best practices for using the VSCode extension |
| 3 | +description: Recommended ways to get the most out of CodeRabbit's VSCode extension. |
| 4 | +--- |
| 5 | + |
| 6 | +Maximize your productivity and code quality with these best practices for the CodeRabbit VSCode extension. For setup instructions, see [Install the VSCode extension](/guides/install-vscode). To get started, visit [Use the VSCode extension](/guides/use-vscode). |
| 7 | + |
| 8 | +## Recommended setup |
| 9 | + |
| 10 | +- **Set a default comparison branch** |
| 11 | + Choose your main development branch (e.g., `main`, `develop`, or trunk) as the default for reviews. This ensures consistent and relevant diffs. |
| 12 | + → Use `CodeRabbit: Base Branch` in the Command Palette. |
| 13 | + |
| 14 | +- **Enable auto-reviews on commit** |
| 15 | + Let CodeRabbit automatically review your code after each commit to catch issues early and maintain momentum. |
| 16 | + → Toggle `CodeRabbit: Auto Review on Commit` in extension settings. |
| 17 | + |
| 18 | +- **Pin CodeRabbit to the sidebar** |
| 19 | + Keep the CodeRabbit icon visible in the activity bar for instant access to reviews and history. |
| 20 | + |
| 21 | +- **Keep Git in sync** |
| 22 | + Regularly fetch and rebase or merge from your base branch. This keeps your diffs clean and prevents unnecessary noise in reviews. |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Daily workflow tips |
| 27 | + |
| 28 | +### 1. Commit often, review often |
| 29 | + |
| 30 | +Make small, frequent commits. CodeRabbit can review incremental changes, helping you spot issues early and keep reviews manageable. |
| 31 | + |
| 32 | +### 2. Use manual reviews for partial code |
| 33 | + |
| 34 | +For work-in-progress or uncommitted changes, use `CodeRabbit: Review Selected Files` or `Review Current Changes`. This is ideal for exploratory or experimental work. |
| 35 | + |
| 36 | +### 3. Follow up on comments |
| 37 | + |
| 38 | +Always address CodeRabbit’s suggestions. Even if you disagree, double-check the feedback. Use comments as a checklist before pushing to remote. |
| 39 | + |
| 40 | +### 4. Re-review after refactoring |
| 41 | + |
| 42 | +After significant changes or refactoring, run `Review Current Branch` again to validate new logic and catch regressions. |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +## Performance tips |
| 47 | + |
| 48 | +- **Avoid large, monolithic commits** |
| 49 | + Break up big changes into logical units. This speeds up reviews and improves feedback accuracy. |
| 50 | + |
| 51 | +- **Close unused VSCode windows** |
| 52 | + Running multiple VSCode instances with the extension can impact performance. |
| 53 | + |
| 54 | +- **Use `.coderabbitignore`** |
| 55 | + Exclude files or directories you don’t want reviewed to reduce clutter and speed up analysis. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Team collaboration tips |
| 60 | + |
| 61 | +- **Share `.vscode/settings.json`** |
| 62 | + Align CodeRabbit settings (like base branch and ignored paths) across your team for consistency. |
| 63 | + |
| 64 | +- **Document your CodeRabbit workflow** |
| 65 | + Add a section to your project README outlining when to run reviews, what to check, and how to handle feedback. |
| 66 | + |
| 67 | +- **Integrate with CI** |
| 68 | + Use CodeRabbit both locally and in your CI pipeline for consistent, automated code reviews. |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## Keep your tools updated |
| 73 | + |
| 74 | +- Regularly update the CodeRabbit extension for the latest features and fixes. |
| 75 | +- Keep VSCode and Git up to date for best compatibility. |
| 76 | +- Watch the [CodeRabbit GitHub repo](https://github.com/coderabbitai/coderabbit-vscode) for release notes and updates. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +By following these practices, you’ll catch bugs earlier, streamline your workflow, and write more reliable code with confidence. |
0 commit comments