Skip to content

Auto-Fix Workflow

Fresh

Fix Greptile code review comments directly from your IDE using MCP tools. Fetch unaddressed issues, apply suggested fixes, and track resolution progress.

Use Greptile MCP tools to fetch unaddressed comments and apply fixes directly from your IDE.

Note

Prerequisite: Configure MCP in your IDE before following these workflows.

Tip

Using Claude Code? Agent skills automate the entire auto-fix loop for you. Run /check-pr to fix all review comments on a PR, or /greploop to iterate until Greptile gives a 5/5 confidence score.

Your First Auto-Fix

Fetch unaddressed comments

Ask your AI assistant:

```text theme={}
List unaddressed Greptile comments for PR #5 in owner/repo
```

The assistant calls `list_merge_request_comments` with `addressed: false`.

!Unaddressed PR comments

Review the response

You'll see comments with their details including file path, issue type, and whether a fix is available.

Apply fixes

For comments with `hasSuggestion: true`:

```text theme={}
Apply the suggested fix for the API token issue
```

The assistant applies the `suggestedCode` to your file.

!Code changes for review

Accept changes

Review the changes, then click **Keep All** to apply them to your codebase.

Commit changes

After applying fixes, commit your changes. Greptile automatically marks comments as addressed when the file is modified.

Understanding Comment Fields

When you fetch comments, each one includes these key fields:

FieldTypeDescription
isGreptileCommentbooleantrue if from Greptile
addressedbooleantrue if resolved by subsequent commit
hasSuggestionbooleantrue if includes a code fix
suggestedCodestringThe actual fix (when hasSuggestion is true)
filePathstringFile location (null for PR-level comments)
lineStart / lineEndnumberLine range (null for general comments)
linkedMemoryobjectCustom context that triggered this comment

How Comments Get "Addressed"

A comment becomes addressed when there's a commit after the comment that modifies the relevant file:

text
1. Greptile comments on src/auth.ts
2. Developer pushes commit touching src/auth.ts  
3. Comment marked as addressed: true

Check progress via reviewAnalysis.reviewCompleteness (e.g., "2/5 Greptile comments addressed").


Common Prompts

Get all comments with fixes

```text theme={}
List all Greptile comments on PR #5 that have suggested code fixes
```

The assistant filters for `hasSuggestion: true`.

Fix style issues only

```text theme={}
Find Greptile comments about style or formatting and apply the fixes
```

Searches comment bodies for style-related keywords.

Check if PR is ready to merge

```text theme={}
What's the review status for PR #5? Are there any unaddressed critical issues?
```

Uses `get_merge_request` and checks `reviewAnalysis.reviewCompleteness`.

Get comments for specific file

```text theme={}
Show Greptile comments for src/auth/login.ts
```

Filters results by `filePath`.

See what custom context triggered a comment

```text theme={}
Why did Greptile flag this issue? Show the linked coding pattern.
```

Checks the `linkedMemory` field for the associated custom context.

Next Steps

Agent Skills

Automate the full auto-fix loop with `/check-pr` and `/greploop`

Custom Context

Learn how `linkedMemory` connects comments to your patterns

Tools Reference

Complete field documentation for all responses

Source

Mirrored from the official Greptile documentation. Self-contained reference copy.