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.
Be specific
'Fix the auth bug' is vague. 'Fix the bug in AuthService.refreshToken() where sessions expire 1 hour early' is actionable.
Include success criteria
'...and all existing tests should pass' gives the agent a clear way to verify its own work.
Set scope boundaries
'Only touch files in src/api/. Do not modify the frontend.' prevents agents from going too far.
Specify the output
'Open a PR with the changes' or 'commit to the feature/auth branch' tells the agent what "done" looks like.
Good task template
[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:
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:
vyre agent run --task "Format all files" --model claude-haiku-3-5Set max duration
Always set --max-duration to prevent runaway tasks:
vyre agent run --task "..." --max-duration 300 # 5 minutesTasks 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:
vyre agent run --task "Audit the codebase for security issues and report findings" --no-writeRead-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.