PluginWorks in Claude CodeCurrent
Greptile
AI code review agent for GitHub and GitLab. View and resolve Greptile's PR review comments, run reviews on your working branch, and search your organization's knowledge base and coding patterns, directly from Claude Code.
0
Try it
See what this would do for you. No sign-up needed.
Install in Claude Code
Run these in Claude Code, in order. The first adds the marketplace, the second installs the plugin.
Step 1
/plugin marketplace add anthropics/claude-plugins-official
Step 2
/plugin install greptile@claude-plugins-official
Review commands before running them. Promptu never runs code on your machine or pushes changes to your repo.
What's inside
2 skills
- login
- review
1 MCP server
Security scan
Not scanned yet
Promptu couldn't check all of this plugin's files, so it shows no scan result. Read the source before installing.
Only 6 of 7 files were checked automatically.
Details
# Greptile
[Greptile](https://greptile.com) is an AI code review agent for GitHub and GitLab that automatically reviews pull requests. This plugin gives Claude Code and Codex two ways to work with it:
- the **Greptile MCP server**, for reading and resolving review results, and for searching your organization's knowledge base and coding patterns
- the **Greptile CLI**, for dispatching a review of your working branch before a pull request exists
They are two ends of one pipeline. The CLI dispatches reviews; the MCP server reads them back — both the ones the CLI dispatched (`source: "headless"`) and the ones Greptile ran on your pull requests (`source: "pr"`).
## Setup
Nothing to install and no API key to create.
**MCP server.** Open the `/mcp` menu and authenticate **greptile**. Your browser opens [auth.greptile.com](https://auth.greptile.com); sign in and approve access. Claude Code stores and refreshes the tokens. In Codex, connect it from the plugin settings.
**CLI.** Run `/greptile:login` once and sign in through the same OAuth provider. The CLI ships with this plugin, so there is no npm or Homebrew install to do — but it is a Node program, so Node must be on your machine. In Codex, ask it to sign in with the plugin's `login` skill.
The two sign-ins are separate: same Greptile account, same OAuth provider, but the CLI keeps its own credentials in `~/.greptile/auth.json` while Claude Code keeps the MCP tokens in its own store. Use whichever surface you need; you only have to sign in to that one.
## Commands
- `/greptile:review` - Review the current branch against its base. Accepts a base branch and free-text instructions ("focus on the auth changes").
- `/greptile:login` - Sign the CLI in to your Greptile account.
In Codex, these are the `review` and `login` skills.
## Tools
### Account and repositories
- `get_me` - Identify your account and available organizations
- `list_repositories` - Discover accessible repositories and identifiers for the other tools
### Pull requests
- `list_merge_requests` / `list_pull_requests` - List PRs, filtered by repository, branch, author, or state
- `get_merge_request` - Detailed PR info, including stored addressed flags and commits since the latest review comment
- `list_merge_request_comments` - All comments on a PR, with Greptile comments identified by `isGreptileComment`
### Code reviews
- `list_code_reviews` - List code reviews, filtered by repository or status
- `get_code_review` - Full review body, status, summary citations, and review metadata
- `trigger_code_review` - Start a Greptile review on a pull request (GitHub and GitLab)
- `search_greptile_comments` - Search Greptile's review comments across every review, on pull requests and on headless CLI runs alike
### Knowledge base
- `list_knowledge_bases` - Repositories your organization has knowledge base data for
- `list_knowledge_base_documents` - Document paths in a repository's published knowledge base
- `get_knowledge_base_document` - Markdown body of a single knowledge base document
- `search_knowledge_base` - Substring search across one repository's knowledge base
### Custom context
- `list_custom_context` - Your organization's coding patterns and rules
- `get_custom_context` - Details for one entry and linked comment references
- `search_custom_context` - Search entries by content
- `create_custom_context` - Create a new entry, either a custom instruction (the default) or a pattern
### Analytics
- `get_analytics_overview` - Summary metrics and period changes, chart series, and repository, contributor, and pull request rankings
- `list_analytics_findings` - Findings with severity and security totals and trends, filterable by team, repository, author, severity, or status
- `list_analytics_filter_options` - The teams, repositories, and authors available to you as analytics filters
## Example usage
- "Review my current branch with Greptile and fix what it finds"
- "Show me Greptile's comments on my current PR and help me resolve them"
- "What issues did Greptile find on PR #123?"
- "Search our knowledge base for how authentication works in this repo"
## Bundled CLI
`scripts/greptile.mjs` is the Greptile CLI, vendored from the published npm package
`greptile` (its `dist/greptile.js`, renamed only so Node reads it as ESM without a
sibling `package.json`). `scripts/greptile.version` records which release it is, and
CI verifies the file byte-for-byte against that version's npm tarball, so the copy
running here is the same one npm serves.
Because the CLI ships with the plugin, it updates with the plugin — not through
`greptile update`, `npm`, or `brew`. Any separate `greptile` you have installed is
untouched and unused by these commands, though both share your login at
`~/.greptile/auth.json`.
## Network access
This plugin registers no hooks. What it contacts:
- `api.greptile.com` — the MCP server, the CLI's API, and CLI telemetry
(below).
- `auth.greptile.com` — OAuth sign-in, for both surfaces.
- `app.greptile.com` — link targets printed in review output.
- `127.0.0.1` — a loopback listener the CLI opens to receive the OAuth
callback during `/greptile:login`, closed as soon as the redirect arrives.
### Telemetry
The bundled CLI reports anonymous usage events to `/v1/telemetry` on the same
host as its API. The events are lifecycle signals — `cli_first_run`,
`cli_login_started`, `cli_login_failed`, `cli_onboarding_started`,
`cli_skill_installed`, `cli_skill_updated`, `cli_review_blocked`,
`cli_update_completed` — carrying your install method, OS, architecture,
whether the run was interactive, and which agent surface it ran under. Nothing
else: no code, no repository or branch names, no file paths, no review content.
Event-specific fields are fixed values: `method`, `exit_code`, `reason`, the
version strings on an update, and the name of the Greptile-authored skill on
the two skill events.
Inside Claude Code and Codex the CLI is always non-interactive, so it cannot ask you to
decide and does not try. It falls back to **anonymous mode**: a random
`cli:<uuid>` stored in `telemetry.json`, no account token attached, and no
profile built on the other end. If you have separately opted in from a
standalone `greptile` on the same machine, that decision carries over here and
events are sent under your account instead.
To turn it off, any one of these is enough:
```sh
export GREPTILE_TELEMETRY_DISABLED=1 # or DO_NOT_TRACK=1
greptile settings set telemetry false # standalone CLI
node "<plugin-root>/scripts/greptile.mjs" settings set telemetry false # bundled CLI
```
`CI=1` also disables it, and a CLI pointed at a self-hosted Greptile sends no
telemetry at all.
### Downloads
One thing here fetches software, and this is it. When a review summary
contains a Mermaid diagram, the CLI renders it with
`mmdr`, a small standalone binary fetched on first use from
[github.com/1jehuang/mermaid-rs-renderer](https://github.com/1jehuang/mermaid-rs-renderer)
into `~/.cache/greptile/bin/`. The archive is checked against a SHA-256 pinned
per platform inside the bundle and is deleted rather than run if the hash does
not match; the download announces itself on stderr, and failing to get it
degrades the diagram to a link instead of failing the review. Setting
`GREPTILE_NO_AUTO_INSTALL=1` skips it. **`/greptile:review` already sets that
variable**, so the plugin does not download it — the code path is reachable
only if you invoke the bundled CLI yourself without it.
## Packaging for the OpenAI directory
The OpenAI directory takes a ZIP of the plugin. From the repository root, package a committed revision, including the bundled CLI, without repository-only files:
```sh
git archive --format=zip --output=/tmp/greptile-plugin.zip HEAD:plugins/greptile -- .codex-plugin/plugin.json .mcp.json assets scripts skills LICENSE README.md
```
`.codex-plugin/chatgpt-app-submission.json` holds the tool justifications and
test cases for the submission form.
## Documentation
See [greptile.com/docs/mcp-v2/overview](https://www.greptile.com/docs/mcp-v2/overview).
## skills/login/SKILL.md
---
name: login
description: Sign the Greptile CLI in to your Greptile account
metadata:
internal: true
allowed-tools: Bash(node ${CLAUDE_PLUGIN_ROOT}/scripts/greptile.mjs:*)
---
Sign the Greptile CLI in to the user's Greptile account.
Tell the user a browser window will open and that they need to finish signing
in there, then run:
```
GREPTILE_NO_UPDATE_CHECK=1 node "${CLAUDE_PLUGIN_ROOT}/scripts/greptile.mjs" login
```
Outside Claude Code (Codex), replace `${CLAUDE_PLUGIN_ROOT}` with the plugin
root: the absolute path two folders above this `SKILL.md`.
Give the Bash call a **600000 ms timeout**. The CLI waits up to ten minutes for
the browser round-trip to complete, far longer than the two-minute default.
This opens `auth.greptile.com` and completes an OAuth flow. It signs in the
**CLI**, which keeps its own credentials in `~/.greptile/auth.json`.
The `greptile` MCP server in this plugin authenticates separately, through
Claude Code's own `/mcp` menu — same Greptile account, same OAuth provider,
and the same audience, but a separate token store. A user who wants both
surfaces signs in twice, and signing in here does not authenticate the MCP
server (or the reverse).
If the user wanted MCP tools rather than the CLI, point them at `/mcp` instead.
## skills/review/SKILL.md
---
name: review
description: Review the current branch with Greptile
argument-hint: "[base branch] [what to focus on]"
metadata:
internal: true
allowed-tools: Bash(node ${CLAUDE_PLUGIN_ROOT}/scripts/greptile.mjs:*) mcp__plugin_greptile_greptile__get_code_review mcp__plugin_greptile_greptile__list_code_reviews
---
Run a Greptile review on the current branch, against its base branch.
Build the command from `$ARGUMENTS`, if the user supplied any:
- A branch name they want to review against becomes `--branch '<BRANCH>'`,
quoted the same way as the instructions below.
- Anything else they wrote is what they want the reviewer to focus on. Pass it
as `--instructions '<their words>'` using **single** quotes, so the reviewer
receives their exact text. If their text contains a `'`, replace each one
with `'\''` and change nothing else. Never use double quotes: `$` and
backticks are live inside them, so `$PATH` would silently disappear from the
instructions and `$(...)` would stop the run at a permission prompt.
```
GREPTILE_NO_AUTO_INSTALL=1 GREPTILE_NO_UPDATE_CHECK=1 node "${CLAUDE_PLUGIN_ROOT}/scripts/greptile.mjs" review --agent
```
Outside Claude Code (Codex), replace `${CLAUDE_PLUGIN_ROOT}` with the plugin
root: the absolute path two folders above this `SKILL.md`.
Always pass `--agent`; it selects plain output intended for AI agents.
`GREPTILE_NO_AUTO_INSTALL=1` suppresses the Mermaid renderer download. When a
review summary carries a diagram, the CLI otherwise fetches a small binary
(`mmdr`) into `~/.cache/greptile/bin/` to rasterize it. That is worth doing in
a terminal a person is watching; it is not worth doing here. Claude Code runs
this command without a TTY, so the inline-image path is dead either way and the
diagram degrades to a link to an SVG file — while the download itself would
still stall a review the user is waiting on. The diagram's Mermaid source
reaches you in the review text regardless.
`GREPTILE_NO_UPDATE_CHECK=1` is belt-and-braces. The CLI infers how it was
installed from its own path, and versions before the plugin was recognised read
a copy running from inside this plugin as a standalone install — which would
name an installer that cannot update the plugin's copy. The notice is already
suppressed here because `--agent` is non-interactive, so this only matters if
the command is ever run without it, or the invocation is copied elsewhere.
Updates arrive with the plugin either way.
Give the Bash call a **600000 ms timeout**. A review commonly runs longer than
the two-minute default.
If the run reports that no one is signed in, it prints `not signed in. Set
GREPTILE_API_KEY or run 'greptile login --api-key'`. Prefer OAuth over an API
key: tell the user to run `/greptile:login` (in Codex, the `login` skill), and stop there rather than
starting a browser sign-in inside this command.
This dispatches a **headless** review: it reviews the working branch and does
not need an open pull request. The review is stored on the user's Greptile
account, so the `greptile` MCP tools in this plugin can read it back —
`list_code_reviews` and `get_code_review` return it with `source: "headless"`.
After the review completes, summarize the findings and offer to fix them. Use
`get_code_review` for the full body of any finding you need more detail on.

