Instructing Devin effectively
Cloud Devin burns the most ACUs when the first message is vague. Official guidance is blunt: be as specific as possible — provide the same detail you would give a coworker with a written spec.
Hub: Tokenminning in Devin. Metering: Cloud ACUs, Token usage.
What makes a prompt work
From Instructing Devin Effectively , strong prompts combine:
| Element | Why it saves ACUs |
|---|---|
| Concrete scope | Repo, files, subsystem named — less exploration |
| Task breakdown | Numbered sub-tasks with logical order — fewer dead ends |
| Success criteria | Tests, CI, status codes, UI checks — Devin self-validates instead of guessing |
| Pointers to patterns | Filenames, doc links, example modules — reuses existing design |
Do make design decisions for Devin:
Optimize the
getOrderDetailsquery inorderService.jsby adding a composite index onorder_idandproduct_idinorder_items. Replace the correlated subquery with a JOIN toproducts. Runnpm testafter each iteration.
Don’t leave architecture open:
Improve our database performance.
Pre-task checklist
Before starting a cloud session, from When to use Devin :
Task definition
- Clear start and end
- Explicit success criteria (tests pass, CI green, matches existing pattern)
- For complex work: scope with Ask Devin first — investigate codebase and generate a high-context prompt before implementation
Available context
- Example files or modules to mirror
- Links to API docs, design specs, or Figma via MCP
- Relevant MCP integrations (Sentry, Datadog, databases) connected before the session
Success validation
- Test suites, lint, build steps Devin can run autonomously
- Browser QA instructions: spin up app, navigate flows, screenshot at breakpoints
- Devin Review with Auto-Fix for closed-loop PR iteration
Task size
- Rule of thumb: if you could finish in ~3 hours, Devin can likely handle it
- Larger work: split into sub-tasks — one session per sub-task, run in parallel when independent
- Target XS–M session size in Session Insights (L/XL = unhealthy)
Session size as a guardrail
| Size | ACU (self-serve) | Messages | Action |
|---|---|---|---|
| XS–M | ≤ 10 | ≤ 10 | Healthy — replicate prompt pattern |
| L | ≤ 20 | ≤ 20 | Review Issue Timeline; split next time |
| XL | > 20 | > 20 | Break task apart; fix environment gaps |
High ACU with few user messages → autonomous retries (check environment). Many messages with low ACU → underspecified initial prompt (use Improved Prompt from Session Insights).
Validation and checkpoints
Tell Devin how to prove correctness before opening a PR:
When modifying the API, confirm the endpoint returns 200 and includes fields id, name, status.
Run npm test after each checkpoint.
Ensure CircleCI passes before pushing.
Pass ESLint/Prettier before any commit.For UI work, ask Devin to test in its browser: run npm run dev, navigate to the page, record the flow, compare against design specs.
Playbooks vs Knowledge
| Mechanism | Use for | Token impact |
|---|---|---|
| Playbooks | Repeatable step-by-step procedures (CI triage, release checklist) | Reusable prompt — less retyping |
| Knowledge | Org conventions, deployment steps, common fixes | Retrieved when relevant — trim misleading items flagged in Session Insights |
Playbooks = task procedures. Knowledge = persistent context across sessions. Do not duplicate the same prose in chat, Knowledge, and AGENTS.md.
After the session
- Open Session Insights — read Improved Prompt and Action Items
- Update Knowledge if Misleading Knowledge was flagged
- Save effective prompts as Playbooks for the team
- Fix recurring machine-setup issues so future sessions start clean
Related
- Devin hub
- Cloud ACUs
- Devin CLI — local work and
/handoff - Rules — Desktop context cost
- Good vs bad instructions
- Prompt templates cheat sheet