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
Terragon receives full context about the PR/issue and your comment
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.
Model Selection
The model selected for a github mention is selected based on the following priority:
- Model specified in the comment (e.g.,
@terragon-labs [sonnet] ...) - Model configured in a "Github Mention" automation (if exists)
- Your default model specified in GitHub & Pull Request Settings.
- The last model used in the task (If not creating a new task)
- Your last selected model in the dashboard.
If an @terragon-labs mention will follow up on an existing task, the first selected model that is valid for the agent will be used. For example, if using Claude Code for a task, specifying @terragon-labs [gpt-5.1] ... will have no effect on the model selected.
Here's a table of how to specify the model for each agent directly in the the github mention comment:
| Agent | Model | Example |
|---|---|---|
| Claude Code | Sonnet | @terragon-labs [sonnet] ... |
| Claude Code | Haiku | @terragon-labs [haiku] ... |
| Claude Code | Opus | @terragon-labs [opus] ... |
| Codex | GPT-5.1 | @terragon-labs [gpt-5.1] ... |
| Codex | GPT-5.1-Codex-Max-Low | @terragon-labs [gpt-5.1-codex-max-low] ... |
| Codex | GPT-5.1-Codex-Max-Medium | @terragon-labs [gpt-5.1-codex-max] ... OR @terragon-labs [gpt-5.1-codex-max-medium] ... |
| Codex | GPT-5.1-Codex-Max-High | @terragon-labs [gpt-5.1-codex-max-high] ... |
| Codex | GPT-5.1-Codex-Max-XHigh | @terragon-labs [gpt-5.1-codex-max-xhigh] ... |
| Codex | GPT-5.1-Codex-Low | @terragon-labs [gpt-5.1-codex-low] ... |
| Codex | GPT-5.1-Codex-Medium | @terragon-labs [gpt-5.1-codex-medium] ... |
| Codex | GPT-5.1-Codex-High | @terragon-labs [gpt-5.1-codex-high] ... |
| Codex | GPT-5 | @terragon-labs [gpt-5] ... |
| Gemini | Gemini 3 Pro | @terragon-labs [gemini-3-pro] ... |
| Gemini | Gemini 2.5 Pro | @terragon-labs [gemini-2.5-pro] ... |
| OpenCode | Grok Code Fast 1 | @terragon-labs [grok-code] ... |
| OpenCode | Qwen3 Coder 480B | @terragon-labs [qwen3-coder] ... |
| OpenCode | Kimi K2 | @terragon-labs [kimi-k2] ... |
| OpenCode | GLM 4.6 | @terragon-labs [glm-4.6] ... |
| OpenCode | Gemini 2.5 Pro | @terragon-labs [opencode/gemini-2.5-pro] ... |
| Amp | Amp | @terragon-labs [amp] ... |
Prompt & Trigger Customizations
You can customize the prompt for a github mention using the "Github Mention" automation. Users on the pro tier can also customize and enable bots to mention @terragon-labs on GitHub to kick off tasks for them.
How Terragon Works with GitHub
Automatic PR Creation
When working on a task, Terragon:
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:
# View PR details and comments
gh pr view 123 --comments
# Check issue information
gh issue view 456
# Understand repository context
gh repo viewCustom 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 #234Terragon will fetch issue details and link the PR appropriately.
Quick GitHub Actions
For tasks with associated pull requests, Terragon provides quick actions directly above the prompt box to help you manage CI workflows:
Fix Failing CI Checks
When your PR has failing GitHub checks, a Fix it button appears that allows you to:
- Automatically create a follow-up message to the agent to address CI failures
- Let the agent investigate and fix the failing tests or checks
- Get your PR back to a passing state quickly

Mark PR as Ready for Review
When your draft PR has all checks passing, a Ready for review button appears to:
- Mark your draft PR as ready for review with one click
- Signal to your team that the changes are ready for feedback
- Move your PR forward in the review process

These actions help you move faster by reducing context switching between Terragon and GitHub.
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.