Cloud Agent Best Practices

Cloud agents are powerful but require thoughtful task design. Follow these practices to get reliable, cost-effective results.

Designing good tasks

The most important factor in cloud agent success is task quality. Cloud agents don't have you sitting next to them to clarify — they need a complete, unambiguous task description.

Good task template

code
[Context]: [1-2 sentences about the codebase context]
[Task]: [What specifically needs to be done]
[Constraints]: [What not to change, edge cases to handle]
[Verification]: [How to verify the work is correct]
[Output]: [What to do when done — commit, PR, issue]

Example:

code
Context: We have an Express.js REST API with JWT authentication.
Task: Add rate limiting to all /api/auth/* routes. 
      Limit to 5 requests per minute per IP.
Constraints: Use the existing `express-rate-limit` package 
             (already installed). Don't touch any other routes.
Verification: Run `npm test` — all auth tests must pass.
             Manually verify by hitting /api/auth/login 6 times quickly.
Output: Open a PR titled "feat: rate limit auth routes"

Cost optimization

Choose the right model

Use faster, cheaper models for simpler tasks:

  • Claude Haiku — formatting, renaming, simple edits, documentation
  • Claude Sonnet — most coding tasks (default)
  • Claude Opus — only for the most complex architectural decisions

Specify the model per task:

bash
vyre agent run --task "Format all files" --model claude-haiku-3-5
Set max duration

Always set --max-duration to prevent runaway tasks:

bash
vyre agent run --task "..." --max-duration 300  # 5 minutes

Tasks that exceed the limit are automatically stopped. You keep a transcript of what was done so far.

Use no-write for research tasks

If you want the agent to analyze code and report findings without making changes, add --no-write:

bash
vyre agent run --task "Audit the codebase for security issues and report findings" --no-write

Read-only tasks use less tokens because they don't need to plan and verify writes.

Reliability patterns

  • Always include a test verification step — agents that can run tests catch their own mistakes.
  • Break large tasks into smaller runs — a 60-minute task is harder to recover from than three 20-minute tasks.
  • Use branches, not main — always have cloud agents work on a feature branch and merge via PR review.
  • Monitor the first few runs — watch new automations closely before letting them run unsupervised.

The best cloud agent runs have clear task descriptions, a verification step (running tests), and a defined output (a PR). These three elements make agent runs highly reliable.