Skip to content

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.

Rover resolves context URIs through built-in providers. You can combine multiple sources in a single command.

URI formatDescriptionExample
github:issue/<number>GitHub issue from the current repogithub:issue/15
github:pr/<number>GitHub PR with diff from the current repogithub:pr/42
github:<owner>/<repo>/issue/<number>Cross-repo GitHub issuegithub:acme/api/issue/8
github:<owner>/<repo>/pr/<number>Cross-repo GitHub PR with diffgithub: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 resourcehttps://example.com/api-spec.yaml

Pass one or more --context flags when creating a task. Each flag accepts a context URI.

Creating a task with context

  1. 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. 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. 3

    Follow the task progress

    Terminal window
    rover logs -f 1

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. 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. 2

    Follow the iteration progress

    Terminal window
    rover logs -f 1 2

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.

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:

Terminal window
# Trust specific authors
rover 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:

Terminal window
rover iterate 1 "Address remaining review comments" -c github:pr/42 --context-trust-all-authors
  • 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-authors on repositories where you trust all contributors. For open-source projects with external contributors, prefer --context-trust-authors with specific usernames.