> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qodo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Scan repo discussions

<Badge color="outline-provider" size="sm" shape="pill" icon="github">GitHub</Badge>

<Warning>
  **Git Integration (formerly Qodo Merge)** – AI code review agents for pull requests. This documentation describes the Qodo v1 experience. For the Qodo v2 documentation, click [here.](/code-review)
</Warning>

The `scan_repo_discussions` tool analyzes past PR discussions and metadata to identify recurring feedback patterns, then generates a `best_practices.md` file with key insights and recommendations.

The `best_practices.md` file captures patterns specific to your team's workflow, based on real PR discussions. Qodo uses it to give more tailored, context-aware suggestions in future pull requests.

<CardGroup>
  <Card title="Learn more about the best practices file." icon="book" horizontal href="/v1/features/best-practices" />
</CardGroup>

<Warning>
  **Active repositories are needed**

  The tool is designed to work with real-life repositories, as it relies on actual discussions to generate meaningful insights.

  Notice that **at least 50 merged PRs** are required to generate a `best_practices.md` file.
</Warning>

## How to use the `/scan_repo_discussions` tool

**Manual usage**

Comment on the PR:

```bash theme={null}
/scan_repo_discussions
```

Qodo will create a new PR that contains an auto-generated `best_practices.md` file.

<Note>
  **Note:** Since up to 250 PRs are scanned, the scan could take several minutes to complete.
</Note>

## Configuration options

To force generating a PR with a new `best_practices.md` file, even if it already exists, use:

```bash theme={null}
/scan_repo_discussions --scan_repo_discussions.force_scan=true
```

To specify how many days of discussions should be included in the scan, use:

```bash theme={null}
/scan_repo_discussions --scan_repo_discussions.days_back=X # Default is 365
```

To specify the minimum number of merged PRs needed to generate the `best_practices.md` file, use:

```bash theme={null}
/scan_repo_discussions --scan_repo_discussions.minimal_number_of_prs=X # Default is 50
```

## Example usage

<Frame>
  <img src="https://mintcdn.com/qodo/uIkZ6kAWHm6WXqrW/images/v1/image-190.png?fit=max&auto=format&n=uIkZ6kAWHm6WXqrW&q=85&s=60dd998ab97a78c680562459aba121b2" alt="" width="863" height="335" data-path="images/v1/image-190.png" />
</Frame>

The PR created by the bot:

<Frame>
  <img src="https://mintcdn.com/qodo/uIkZ6kAWHm6WXqrW/images/v1/image-191.png?fit=max&auto=format&n=uIkZ6kAWHm6WXqrW&q=85&s=58b14e7dacf134342b31bc0b6824ce6a" alt="" width="828" height="427" data-path="images/v1/image-191.png" />
</Frame>

The `best_practices.md` file in the PR:

<Frame>
  <img src="https://mintcdn.com/qodo/uIkZ6kAWHm6WXqrW/images/v1/image-192.png?fit=max&auto=format&n=uIkZ6kAWHm6WXqrW&q=85&s=866ff38f49c22f94fd0f2f63cb3414c9" alt="" width="1471" height="811" data-path="images/v1/image-192.png" />
</Frame>
