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

# Claude Code Plugin

> Install and use the Greptile plugin for Claude Code

The Greptile plugin for Claude Code gives you direct access to your code reviews from the terminal. Fetch PR comments, apply fixes, and search review feedback without leaving your workflow.

<Note>
  **Prerequisite:** Create a Greptile account at [app.greptile.com](https://app.greptile.com/signup) and connect your repositories.
</Note>

## Installation

<Steps>
  <Step title="Get Your API Key">
    Go to [app.greptile.com/settings/organization/api](https://app.greptile.com/settings/organization/api) (Settings > Organization > API Keys) and copy your API key.
  </Step>

  <Step title="Set Environment Variable">
    Add your API key to your shell configuration:

    ```bash theme={}
    export GREPTILE_API_KEY="your-api-key"
    ```
  </Step>

  <Step title="Open Claude Code">
    Launch Claude Code in your terminal:

    ```bash theme={}
    claude
    ```

    <Frame>
      <img src="https://mintcdn.com/greptile/mqm9EZoEmPNEwGYU/images/claude-code-welcome.png?fit=max&auto=format&n=mqm9EZoEmPNEwGYU&q=85&s=17aa9cd70b8e46b132fc653bac955ea7" alt="Claude Code welcome screen" width="567" height="370" data-path="images/claude-code-welcome.png" />
    </Frame>
  </Step>

  <Step title="Open Plugin Browser">
    Type `/plugins` to open the plugin discovery interface.

    <Frame>
      <img src="https://mintcdn.com/greptile/mqm9EZoEmPNEwGYU/images/claude-code-plugins.png?fit=max&auto=format&n=mqm9EZoEmPNEwGYU&q=85&s=40edeb9c394fadf3a8375875025dd2f9" alt="Claude Code plugin browser" width="1146" height="688" data-path="images/claude-code-plugins.png" />
    </Frame>
  </Step>

  <Step title="Search for Greptile">
    Type `greptile` to search for the plugin.

    <Frame>
      <img src="https://mintcdn.com/greptile/mqm9EZoEmPNEwGYU/images/claude-code-greptile-search.png?fit=max&auto=format&n=mqm9EZoEmPNEwGYU&q=85&s=96bfe7e06453b4060cc1b22dd4ee033e" alt="Searching for Greptile plugin" width="1130" height="608" data-path="images/claude-code-greptile-search.png" />
    </Frame>
  </Step>

  <Step title="Install">
    Select the Greptile plugin and choose your installation scope:

    * **User scope** — Available in all your Claude Code sessions
    * **Project scope** — Available to all collaborators on this repository
    * **Local scope** — Available only in this repository for you

    <Frame>
      <img src="https://mintcdn.com/greptile/mqm9EZoEmPNEwGYU/images/claude-code-greptile-install.png?fit=max&auto=format&n=mqm9EZoEmPNEwGYU&q=85&s=d1650a36f4991cac79ec21168749cc79" alt="Greptile plugin installation options" width="1138" height="662" data-path="images/claude-code-greptile-install.png" />
    </Frame>
  </Step>
</Steps>

## What You Can Do

Once installed, ask Claude Code to work with your Greptile reviews using natural language.

### Fix All Comments on a PR

```
Show me all Greptile comments on my open PR and fix them
```

Claude will fetch unaddressed comments, analyze the suggested fixes, and apply them directly to your code.

<Frame caption="Claude applies a fix for invalid date handling based on Greptile's review comment">
  <img src="https://mintcdn.com/greptile/mqm9EZoEmPNEwGYU/images/claude-code-fix-comment.png?fit=max&auto=format&n=mqm9EZoEmPNEwGYU&q=85&s=795ebc305f0f90d98811184ee6258c53" alt="Claude Code applying a fix from a Greptile comment" width="1864" height="594" data-path="images/claude-code-fix-comment.png" />
</Frame>

### Analyze Security Concerns

```
Get the full review analysis for PR #2 and explain the security concerns
```

Claude fetches the complete review and breaks down any security-related feedback.

<Frame caption="Full review analysis showing security issues, bug issues, and priority recommendations">
  <img src="https://mintcdn.com/greptile/mqm9EZoEmPNEwGYU/images/claude-code-security-analysis.png?fit=max&auto=format&n=mqm9EZoEmPNEwGYU&q=85&s=663a3092579aa90dd6c4dc92d5357068" alt="Claude Code showing security analysis from Greptile review" width="2070" height="1390" data-path="images/claude-code-security-analysis.png" />
</Frame>

### Summarize Blocking Issues

```
Find all my open PRs with unresolved Greptile comments and summarize what's blocking them
```

Get a quick overview of what needs attention across all your open pull requests.

<Frame caption="Summary of open PRs with blockers, organized by severity">
  <img src="https://mintcdn.com/greptile/mqm9EZoEmPNEwGYU/images/claude-code-pr-summary.png?fit=max&auto=format&n=mqm9EZoEmPNEwGYU&q=85&s=6f427ff1529227857ab664009942b14c" alt="Claude Code summarizing blocking issues across PRs" width="1484" height="1426" data-path="images/claude-code-pr-summary.png" />
</Frame>

## Example Prompts

### Pull Requests & Reviews

| Task                | Prompt                                                    |
| ------------------- | --------------------------------------------------------- |
| List your open PRs  | "Show me all my open pull requests"                       |
| Filter by author    | "List PRs authored by @johndoe"                           |
| Get PR details      | "Get the full details for PR #42 including review status" |
| Check review status | "Has PR #15 been reviewed? What's still unaddressed?"     |
| Trigger a review    | "Run a Greptile review on PR #8"                          |

### Working with Comments

| Task                      | Prompt                                                             |
| ------------------------- | ------------------------------------------------------------------ |
| List unaddressed comments | "What Greptile comments are still unaddressed on PR #5?"           |
| Fix a specific comment    | "Fix the null check issue Greptile found in auth.ts"               |
| Fix all comments          | "Show me all unaddressed comments and fix them one by one"         |
| Search across repos       | "Search for comments mentioning 'SQL injection' across all my PRs" |
| Find patterns             | "What are the most common issues Greptile has flagged this month?" |

### Custom Context

| Task                  | Prompt                                                                               |
| --------------------- | ------------------------------------------------------------------------------------ |
| List coding standards | "What custom context rules does my org have?"                                        |
| Search for a pattern  | "Do we have any rules about error handling?"                                         |
| Create a new rule     | "Create a custom context rule: always use parameterized queries for database access" |

## Available Tools

The plugin uses Greptile's [MCP server](/docs/mcp-v2/overview), giving you access to 11 tools:

<AccordionGroup>
  <Accordion title="Pull Request Tools (3)">
    * **list\_pull\_requests** — List PRs with filters (author, state, branch)
    * **get\_merge\_request** — Get full PR details including review analysis
    * **list\_merge\_request\_comments** — Get all comments on a PR

    [View full parameters →](/docs/mcp-v2/tools#pull-request-tools)
  </Accordion>

  <Accordion title="Code Review Tools (3)">
    * **list\_code\_reviews** — List reviews with status filters
    * **get\_code\_review** — Get detailed review information
    * **trigger\_code\_review** — Start a new review on a PR

    [View full parameters →](/docs/mcp-v2/tools#code-review-tools)
  </Accordion>

  <Accordion title="Comment Search (1)">
    * **search\_greptile\_comments** — Search all Greptile comments across repos

    [View full parameters →](/docs/mcp-v2/tools#comment-search-tool)
  </Accordion>

  <Accordion title="Custom Context Tools (4)">
    * **list\_custom\_context** — List org coding patterns
    * **get\_custom\_context** — Get pattern details
    * **search\_custom\_context** — Search patterns by content
    * **create\_custom\_context** — Create new patterns

    [View full parameters →](/docs/mcp-v2/tools#custom-context-tools)
  </Accordion>
</AccordionGroup>

### Learn More

* [Agent Skills](/docs/mcp-v2/skills) — Automate the full auto-fix loop with `/check-pr` and `/greploop`
* [Auto-Fix Workflow](/docs/mcp-v2/auto-fix) — Manual patterns for resolving comments from your IDE
* [Custom Context](/docs/mcp-v2/custom-context) — Managing your team's coding standards
* [Reports & Analytics](/docs/mcp-v2/reports) — Generating review metrics and dashboards

## Troubleshooting

<AccordionGroup>
  <Accordion title="Plugin not found">
    Make sure you're running Claude Code v2.1 or later. Check your version and update:

    ```bash theme={}
    claude --version
    claude update
    ```
  </Accordion>

  <Accordion title="Authentication errors">
    Verify your API key is set correctly:

    ```bash theme={}
    echo $GREPTILE_API_KEY
    ```

    If empty, add it to your shell config (`~/.zshrc` or `~/.bashrc`) and restart your terminal.
  </Accordion>

  <Accordion title="No PRs or reviews found">
    Check that:

    * Your repositories are connected in [app.greptile.com](https://app.greptile.com)
    * You have open PRs with Greptile reviews
    * Your API key has access to those repositories
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={3}>
  <Card title="Agent Skills" icon="robot" href="/docs/mcp-v2/skills">
    Automate the full auto-fix loop with `/check-pr` and `/greploop`
  </Card>

  <Card title="Auto-Fix Workflow" icon="wand-magic-sparkles" href="/docs/mcp-v2/auto-fix">
    Manual patterns for resolving review comments
  </Card>

  <Card title="Custom Context" icon="brain" href="/docs/mcp-v2/custom-context">
    Add your team's coding standards for better reviews
  </Card>
</CardGroup>
