Cut a Feature Prompt from 42 to 12 ACUs
Walk through a real session that burned 3x the expected ACUs on a pagination task, pinpoint three root causes, and rewrite the prompt to save 70%.The session that triggered the investigation
A developer asked Devin to add pagination to an API endpoint. The prompt was short and reasonable-sounding:The session finished successfully — tests passed, the PR looked good. But it consumed 42 ACUs for what should have been a ~12 ACU task. Three-and-a-half times the expected cost, on a feature that already had a working pattern elsewhere in the codebase.Here’s how to find out what went wrong and make sure it doesn’t happen again.
Start with Session Insights
Every completed session has a free Session Insights analysis. Click the lightbulb icon in the top bar of any finished session to open it — no Advanced session required.For this pagination session, Session Insights flagged:
- Issue Timeline — Red marks at the 14-minute and 28-minute marks where Devin changed approaches entirely.
- Issues Detected — “Incorrect codebase assumption: built pagination from scratch when
src/utils/paginate.tsalready existed” and “Wrong implementation type: used cursor-based pagination, but tests expect offset-based.” - Improved Prompt — A rewritten version with the missing context filled in, ready to copy.
- ACU Usage — 42 ACUs, flagged as disproportionate for the task scope.
Get a phase-by-phase breakdown with Advanced Devin
Click Investigate with Devin in the Session Insights panel to launch an Advanced Devin session pre-loaded with the original session’s full history. Or start a new Advanced session manually — select the session from the session dropdown and describe what you want analyzed:Advanced Devin reviews every action from the original session and identifies where Devin spent an abnormally long time or took inefficient approaches:Three root causes, all preventable with a better prompt or repo configuration.
Rewrite the prompt and compare
You can ask Advanced Devin to start a new session with the improved prompt directly — no need to copy-paste. The analysis produces a structured prompt that includes exactly the context that was missing:Compare the two prompts side by side:
The optimized prompt eliminates all three root causes. Devin skips the 23-file exploration, picks the right pagination type on the first try, and follows a proven pattern.
| Original | Optimized | |
|---|---|---|
| Pagination type | Not specified | ”offset-based” |
| Existing utility | Not mentioned | src/utils/paginate.ts |
| Reference pattern | None | ”same as GET /api/projects” |
| Response shape | Not specified | Explicit schema |
| Testing criteria | ”Run the tests” | Specific edge cases |
| ACU result | 42 ACUs | ~12 ACUs |
Turn the findings into permanent fixes
A single prompt rewrite saves ACUs on one session. Turning the findings into permanent configuration saves ACUs on every future session.Add recurring context to Knowledge. The pagination analysis revealed two facts Devin needs repeatedly — the pagination type and the utility location. Add them as Knowledge entries so every session starts with that context automatically:
- “All API endpoints use offset-based pagination. The shared utility is at
src/utils/paginate.ts. See GET /api/projects for the reference implementation.” - “Run tests with
npm test. Run type checks withnpm run typecheck.”
npm install failures were caused by a missing .npmrc config for the private registry. Adding registry configuration to repo setup prevents every future session from hitting that error.Batch-analyze to find team-wide patterns. If multiple developers are seeing high-ACU sessions, analyze several at once to find shared root causes: