TerragonTerragon Docs
Integrations

GitHub Integration

Interact with Terragon directly from GitHub

Interact with Terragon directly from GitHub through app mentions, while Terragon handles PR creation and branch management automatically.

GitHub App Mentions

To mention @terragon-labs on GitHub, you must grant Terragon access to the repository you're tagging it in. You can do this in Settings, the repository selector in the prompt box, or in Environments.

How It Works

Mention @terragon-labs in GitHub to create new Terragon tasks:

@terragon-labs can you fix the failing tests?

text @terragon-labs implement the feature described above

@terragon-labs this method could be optimized using memoization 

What Happens

When you mention Terragon:

Terragon immediately reacts with a 👀 emoji to acknowledge your request

A new task is created automatically

Terragon receives full context about the PR/issue and your comment

Work begins in an isolated sandbox

You'll see the task appear in Home

Task Creation Behavior

By default, Terragon keeps a single task per pull request or issue. Repeat mentions of @terragon-labs on the same thread are added as follow-up messages so the conversation history stays in one place.

If you want each mention to kick off a fresh task, enable Create new task when @terragon-labs is tagged on GitHub in GitHub & Pull Request Settings. With this toggle on, Terragon always creates a brand-new task—complete with its own sandbox and timeline—whenever you tag the app on GitHub, even if a task already exists for that PR or issue.

Separate tasks mean separate sandboxes and timelines. Enabling this setting is useful for parallel work or reviewer-specific follow-ups, but you will lose the consolidated discussion history and may need to keep an eye out for duplicated effort.

This preference applies to your Terragon account across every repository you have access to; it is not configurable per repo. Changing the setting does not modify any existing tasks—those continue exactly as they were when they were created.

How Terragon Works with GitHub

Automatic PR Creation

When working on a task, Terragon:

Creates a new branch with your changes
Commits with descriptive messages

Opens a pull request with:

  • Comprehensive description
  • Test plan checklist
  • Co-author attribution to Terry
  • Links to Terragon task

GitHub CLI Access

Every sandbox includes GitHub CLI, allowing Terragon to:

GitHub CLI Examples
# View PR details and comments
gh pr view 123 --comments

# Check issue information
gh issue view 456

# Understand repository context
gh repo view

Custom GitHub Token: Terragon automatically sets the GH_TOKEN environment variable to authenticate the gh CLI. If you need custom permissions you can override it by adding your own GH_TOKEN in Environment Variables. Your custom token will take precedence.

Working with Issues

Reference issues in your prompts:

Fix the authentication bug described in issue #234

Terragon will fetch issue details and link the PR appropriately.

Having issues with GitHub integration? See our Troubleshooting guide for solutions to common problems.

For information about security and permissions, see our dedicated Security & Permissions page.