Provide context to tasks
Context lets you attach external information to a task or iteration so the AI agent can reference it while working. Instead of pasting content into the task description, use context to provide requirements from GitHub issues, design specs from pull requests, reference documentation from local files, or API specifications from URLs.
Supported context sources
Section titled “Supported context sources”Rover resolves context URIs through built-in providers. You can combine multiple sources in a single command.
| URI format | Description | Example |
|---|---|---|
github:issue/<number> | GitHub issue from the current repo | github:issue/15 |
github:pr/<number> | GitHub PR with diff from the current repo | github:pr/42 |
github:<owner>/<repo>/issue/<number> | Cross-repo GitHub issue | github:acme/api/issue/8 |
github:<owner>/<repo>/pr/<number> | Cross-repo GitHub PR with diff | github:acme/api/pr/31 |
file:./<path> | Local file (relative path) | file:./docs/spec.md |
file:///<path> | Local file (absolute path) | file:///home/user/notes.md |
https://<url> | Remote web resource | https://example.com/api-spec.yaml |
Add context to a task
Section titled “Add context to a task”Pass one or more --context flags when creating a task. Each flag accepts a context URI.
Creating a task with context
- 1
Create a task with context from a GitHub issue and a local spec file
Terminal window rover task -c github:issue/15 -c file:./docs/api-spec.md "Implement the new endpoint"Rover fetches the issue content and reads the local file, then provides both to the agent alongside the task description.
- 2
You can also provide context from a remote URL
Terminal window rover task -c https://example.com/openapi.yaml "Generate client SDK from the API spec" - 3
Follow the task progress
Terminal window rover logs -f 1
Add context to an iteration
Section titled “Add context to an iteration”Context works the same way on iterations. Pass --context flags to rover iterate to provide additional information for a follow-up iteration.
Iterating with context
- 1
Add a PR as context to guide a refinement iteration
Terminal window rover iterate 1 "Align the implementation with the reviewed approach" -c github:pr/50 - 2
Follow the iteration progress
Terminal window rover logs -f 1 2
Context inheritance
Section titled “Context inheritance”Context from previous iterations carries forward automatically. When you add new context to an iteration, it is merged with context from earlier iterations.
You don’t need to repeat URIs you’ve already provided. If you pass a URI that was used in a previous iteration, Rover re-fetches it to get the latest content.
Control comment visibility
Section titled “Control comment visibility”When using GitHub issues or PRs as context, comments and reviews are excluded by default to prevent prompt-injection from untrusted contributors.
You can selectively include comments from trusted authors:
# Trust specific authorsrover task -c github:issue/15 --context-trust-authors alice,bob "Fix the bug"
# Trust all authors (use with caution)rover task -c github:pr/42 --context-trust-all-authors "Review and address PR feedback"The same flags work with rover iterate:
rover iterate 1 "Address remaining review comments" -c github:pr/42 --context-trust-all-authorsBest practices
Section titled “Best practices”- Prefer context over copy-paste: Use context URIs instead of pasting content into the task description. This keeps descriptions focused and lets Rover handle formatting and attribution.
- Combine context with clear instructions: Context provides information; the task description should explain what to do with it.
- Scope context narrowly: Provide only the sources relevant to the task. Too much unrelated context can dilute the agent’s focus.
- Use GitHub PRs for alignment: When iterating on a task, referencing a related PR helps the agent understand the desired approach and coding patterns.
- Be deliberate with comment trust: Only enable
--context-trust-all-authorson repositories where you trust all contributors. For open-source projects with external contributors, prefer--context-trust-authorswith specific usernames.