Agents

Pre-Task Cost Estimate

Share

Pre-task cost estimate is an AI interface design pattern that displays a forecast of the expected cost of an agent run (tokens, dollars, wall-clock minutes) before the user clicks to execute. This UX pattern makes spending legible in the same terms the user is about to commit to, replacing the single "Run" button that burns an unknown amount of budget in the background with a transparent scope and spend preview. Estimates are shown as ranges with the precision the system can honestly provide, updated if the plan changes mid-flight, and reconciled against actuals post-run so users calibrate future expectations. The pattern is foundational to cost-aware agent UX: agents are the first class of software where a loop can consume unbounded money without the user realizing, and forecasting is the first line of defense.

Use Case

Essential for AI coding agents, research agents, and long-running automation where forecasting cost and duration before execution prevents budget overruns and sets honest expectations.

Examples in Wild

Cursor AgentClaude CodeDevinOpenAI Assistants API

Use this pattern in your project

Copy this prompt to generate a production-ready implementation in Cursor, Claude Code, Lovable, or any AI coding agent.

Generate a production-ready implementation of the "Pre-Task Cost Estimate" AI interface design pattern.

Pattern Description:
Interactive Demo
Restart demo
Pre-task Cost Estimate
Forecast before run
Within budget cap
Tokens
5,025
Cost
$1.76
ETA
6m
45%
$2.50

Get new patterns by email

Weekly AI interface UX notes and resources on Substack, no spam, unsubscribe anytime.

Subscribe on Substack