---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-review.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/operations/ca-review.md
title: AI code review of a pull request in SourceCraft
description: How to use SourceCraft Code Assistant AI code review to analyze pull requests and get code improvement recommendations.
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt


# AI code review of a pull request in SourceCraft

<!-- source: en/_includes/sourcecraft/disable-ai-features-note.md -->
{% note warning %}

SourceCraft uses the capabilities of AI models within Yandex. For this to work, some of your [organization's](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#org) data needs to be sent to Yandex.

In private organizations, you can [disable](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/disable-ai-features.md) data transfers to Yandex, but this will limit [Code Assistant](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/code-assistant.md)'s capabilities.

{% endnote %}
<!-- endsource: en/_includes/sourcecraft/disable-ai-features-note.md -->

<!-- source: en/_includes/sourcecraft/ai-review-description.md -->
SourceCraft is equipped with a built-in system for automated AI code review of [pull requests](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#pr). The AI assistant analyzes code changes, detects potential errors, architectural issues, and style inconsistencies, and provides code quality improvement recommendations.

With AI code review, you can save time on manual reviews, enhance code robustness and readability, and accelerate the change acceptance process.
<!-- endsource: en/_includes/sourcecraft/ai-review-description.md -->

To run a pull request:
1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M12.5 12.618c.307-.275.5-.674.5-1.118V6.977a1.5 1.5 0 0 0-.585-1.189l-3.5-2.692a1.5 1.5 0 0 0-1.83 0l-3.5 2.692A1.5 1.5 0 0 0 3 6.978V11.5A1.496 1.496 0 0 0 4.493 13H5V9.5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2V13h.507c.381-.002.73-.146.993-.382m2-1.118a3 3 0 0 1-3 3h-7a3 3 0 0 1-3-3V6.977A3 3 0 0 1 2.67 4.6l3.5-2.692a3 3 0 0 1 3.66 0l3.5 2.692a3 3 0 0 1 1.17 2.378zm-5-2A.5.5 0 0 0 9 9H7a.5.5 0 0 0-.5.5V13h3z" clip-rule="evenodd"/></svg> **Home** tab, under <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3.999 3.5h.242c.559 0 1.049.37 1.202.907l.171.598A2.75 2.75 0 0 0 8.26 7h5.24v4a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 11V5a1.5 1.5 0 0 1 1.499-1.5m9.501 2h-1.242a1.25 1.25 0 0 1-1.201-.907l-.171-.598a3 3 0 0 0-.195-.495H12A1.5 1.5 0 0 1 13.5 5zM8.241 2H4a3 3 0 0 0-.457.035A3 3 0 0 0 2 2.764 3 3 0 0 0 1 5v6a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3zM7 3.5h1.242c.559 0 1.049.37 1.202.907l.171.598q.075.261.195.495H8.26a1.25 1.25 0 0 1-1.202-.907l-.171-.598A3 3 0 0 0 6.69 3.5z" clip-rule="evenodd"/></svg> **Your craftspace**, navigate to <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.5 8h11v3a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 11zm10.697-1.5-1.851-2.777a.5.5 0 0 0-.416-.223H5.07a.5.5 0 0 0-.416.223L2.803 6.5zM15 7.408V11a3 3 0 0 1-3 3H4a3 3 0 0 1-3-3V7.408a3 3 0 0 1 .504-1.664l1.902-2.853A2 2 0 0 1 5.07 2h5.86a2 2 0 0 1 1.664.89l1.902 2.854A3 3 0 0 1 15 7.408M9.25 11a.75.75 0 0 0 0-1.5h-2.5a.75.75 0 0 0 0 1.5z" clip-rule="evenodd"/></svg> **Repositories**.
1. Select a repository.
1. Under <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M10.218 3.216a.75.75 0 0 0-1.436-.431l-3 10a.75.75 0 0 0 1.436.43zM4.53 4.97a.75.75 0 0 1 0 1.06L2.56 8l1.97 1.97a.75.75 0 0 1-1.06 1.06l-2.5-2.5a.75.75 0 0 1 0-1.06l2.5-2.5a.75.75 0 0 1 1.06 0m6.94 6.06a.75.75 0 0 1 0-1.06L13.44 8l-1.97-1.97a.75.75 0 0 1 1.06-1.06l2.5 2.5a.75.75 0 0 1 0 1.06l-2.5 2.5a.75.75 0 0 1-1.06 0" clip-rule="evenodd"/></svg> **Code** on the repository page, go to <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M4.788 3.121a1.25 1.25 0 1 1-1.076 2.257 1.25 1.25 0 0 1 1.076-2.257M3.5 6.896l-.068-.02a2.751 2.751 0 1 1 3.415-3.533L8.219 1.97A.75.75 0 0 1 9.28 3.03l-.47.47h.69a3 3 0 0 1 1.139.224A3 3 0 0 1 12.5 6.5v2.604l.068.02a2.751 2.751 0 0 1-.818 5.376A2.75 2.75 0 0 1 11 9.104V6.5q0-.116-.017-.225A1.5 1.5 0 0 0 9.5 5h-.69l.47.47a.75.75 0 0 1-1.06 1.06L6.847 5.157a2.74 2.74 0 0 1-.88 1.242c-.282.225-.61.397-.967.497v2.208l.068.02a2.751 2.751 0 1 1-1.568-.02zm-.312 4.195a1.25 1.25 0 0 0-.182.787 1.25 1.25 0 1 0 .182-.787m7.5 0a1.25 1.25 0 0 0-.181.787 1.25 1.25 0 1 0 .18-.787" clip-rule="evenodd"/></svg> **Pull requests**.
1. Select a pull request.
1. Go to the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M8 13.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0M8.75 5a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0z" clip-rule="evenodd"/></svg> **Overview** tab, hover over the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M8 13.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0M8.75 5a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0z" clip-rule="evenodd"/></svg> **AI code review** row and click **Run**.

    Once the pull request is processed, the indicator next to the **AI code review** row will change to <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M13.5 8a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0m-3.9-1.55a.75.75 0 1 0-1.2-.9L7.419 8.858 6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z" clip-rule="evenodd"/></svg>.

    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><g clip-path="url(#svg-ieb2iwzu__a)"><path fill="currentColor" fill-rule="evenodd" d="M4.61 2.503a6.47 6.47 0 0 1 3.383-.984 6.48 6.48 0 0 1 4.515 1.77l-.004-.559a.75.75 0 1 1 1.5-.013l.021 2.5a.75.75 0 0 1-.743.756l-2.497.022a.75.75 0 1 1-.013-1.5l.817-.007a4.98 4.98 0 0 0-3.583-1.469 4.97 4.97 0 0 0-2.602.756.75.75 0 0 1-.795-1.272m9.097 8.716a6.5 6.5 0 0 0 .84-3.422.75.75 0 1 0-1.5.053 4.97 4.97 0 0 1-.646 2.63 4.98 4.98 0 0 1-3.064 2.37l.403-.712a.75.75 0 0 0-1.306-.738l-1.229 2.173a.75.75 0 0 0 .283 1.022l2.176 1.23a.75.75 0 1 0 .739-1.305l-.487-.275a6.48 6.48 0 0 0 3.79-3.026m-11.258.099a6.47 6.47 0 0 0 2.544 2.438.75.75 0 0 0 .704-1.325 4.97 4.97 0 0 1-1.955-1.875 4.98 4.98 0 0 1-.52-3.838l.415.705a.75.75 0 1 0 1.292-.762L3.66 4.511a.75.75 0 0 0-1.027-.266L.481 5.513a.75.75 0 1 0 .761 1.293l.483-.284a6.48 6.48 0 0 0 .724 4.796" clip-rule="evenodd"/></g><defs><clipPath id="svg-ieb2iwzu__a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg> **SourceCraft Review Bot** will add to the pull request its comments with code improvement recommendations and a general comment describing the changes that were made.

#### Useful links {#see-also}

* [Getting started with SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/code-assistant/index.md)
* [AI in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/code-assistant.md)
* [Editing code in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/code-edit.md)
* [Chat with Code Assistant in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-chat.md)
