# AI tool detection & filters

## Automatic AI tool detection

To help you understand how AI use affects developer productivity metrics, Swarmia automatically detects pull requests assisted by GitHub Copilot, Cursor, or Claude Code. You can see the AI tools involved in an individual pull request by opening it anywhere in the app.

### Local changes (editor/CLI)

A pull request is considered to have local AI changes (editor/CLI) if at least one of these conditions is met:

* Any of its commits were authored or co-authored by an AI tool *(high confidence)*
* Any of its commits has the `Made-with: Cursor` Git trailer *(high confidence)*
* It has the `claude-code-assisted` label *(high confidence)*
* Any of its commits were made by an author who used an AI tool within the previous 24 hours *(low confidence)*

You can see the reason for tagging an individual pull request in a tooltip by hovering over the AI tool badge:

<figure><img src="/files/0Gqal4MVZuKP7ZQd8bJp" alt=""><figcaption></figcaption></figure>

### Cloud agent

Swarmia attributes a PR to a [cloud agent](/features/ai-tools/cloud-agents.md) if the PR or its first commit has been authored by GitHub Copilot, Cursor, or Claude Code.

The AI coding agent used to create a pull request is shown on top of the pull request author’s avatar. You can hover over the avatar to see more details:

<figure><img src="/files/yEsdbTjDesrbvODvCOZ3" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
In Swarmia, pull requests authored by AI tools are attributed to the people who initiated them. For example, if GitHub Copilot creates a PR on your behalf, Swarmia shows you as its author.
{% endhint %}

### Review agent

Swarmia attributes a PR to a review agent if it has reviews from GitHub Copilot, Claude Code, or Cursor.

## AI tool filter

You can use the **AI tool** filter to view pull requests in [Code metrics](/features/metrics/pull-request-cycle-time.md), [PR exclusion rules](/settings/team/team-pr-exclusions.md), and [investment category rules](/settings/organization/investment-balance.md) based on the AI tools involved.

The filter includes two selections:

* **Tools:** GitHub Copilot, Cursor, and Claude Code
* **Modes:** [local changes (editor/CLI)](#local-changes-editor-cli), [cloud agent](#cloud-agent), and review agent
  * For local changes, you can choose to [include high-confidence matches only](#local-changes-high-confidence-only) (read more below)

<figure><img src="/files/FRGIVwNuxGD0CFrDxMoR" alt=""><figcaption></figcaption></figure>

### Local changes: High confidence only

This is an optional setting that applies to [local changes (editor/CLI)](#local-changes-editor-cli) only.

* **Enabled**: Match *only* work directly tagged by AI tools (labeled with *"high confidence"* in [the list above](#local-changes-editor-cli)). This can result in underreporting AI involvement.
* **Disabled**: Also match work based on the authors' activity times in AI tools (labeled with *"low confidence"* in [the list above](#local-changes-editor-cli)). This can result in overreporting AI involvement.

<figure><img src="/files/f9UfbqXje7lGOFpZhMeh" alt=""><figcaption></figcaption></figure>

## Frequently asked questions

### Why is my PR marked AI-assisted even though I didn't use AI for it?

Some AI coding tool providers don't share PR-level activity data in their analytics APIs. To address this, we use certain heuristics, such as checking if the commit authors have used an AI tool within the previous 24 hours. (See [the full list of rules](#local-changes-editor-cli) above.)

This can result in false positives (overreporting AI involvement). For example, if you simultaneously work on tasks A and B, but only use AI for task A, Swarmia inaccurately associates the tool usage also with task B. You can use the [high-confidence filter](#local-changes-high-confidence-only) to avoid reporting false positives.

You can hover over the AI tool label to see the exact attribution reason for any pull request:

<figure><img src="/files/CREIhTUZuy03hrcucIJ4" alt=""><figcaption></figcaption></figure>

### Why is the attribution window 24 hours?

It accounts for cases where you create code with AI today but commit it tomorrow. Also, some AI coding tool providers report user activity only on the daily level, so we can't get more granular than that.

You can use the [high-confidence filter](#local-changes-high-confidence-only) to disable the time-based attribution.

### Why is my PR not attributed to a cloud agent?

Swarmia attributes a PR to a [cloud agent](/features/ai-tools/cloud-agents.md) if the PR or its first commit has been authored by GitHub Copilot, Cursor, or Claude Code.

Example 1: With [GitHub Copilot coding agent](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent), GitHub shows *Copilot* as the PR author. Swarmia shows this as a GitHub Copilot agent PR:

<figure><img src="/files/ApYzPz9iavatqnBZYPB6" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note: Regardless of what GitHub displays, Swarmia always shows the author as the person who initiated the AI coding agent PR.
{% endhint %}

Example 2: When using [Cursor Cloud Agents](https://cursor.com/docs/cloud-agent), GitHub shows *cursoragent* as the author of the first commit, and the user who started the agent as the PR author. Swarmia shows this as a Cursor agent PR:

<figure><img src="/files/UOY7lPT6OwWMj8lVyQVo" alt=""><figcaption></figcaption></figure>

Example 3: The first commit in this PR was authored by *Claude* but committed by *cursoragent*. Swarmia shows this as a Claude Code agent PR:

<figure><img src="/files/uXZLfIhTIDphSmAlXV8C" alt=""><figcaption></figcaption></figure>

### If I ask an AI tool to create a PR with my local changes, is it considered a cloud agent PR?

No, we don't regard that as a cloud agent PR since you review and accept the suggestions (and perhaps manually write some of the code) before creating the PR.

The AI tool uses your local Git identity, so you are marked as the PR author and the commit author. (The tool might mark itself as the co-author, however.)

Swarmia shows these PRs as [local changes](#local-changes-editor-cli).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.swarmia.com/features/ai-tools/ai-tool-detection-and-filters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
