Pre-Task Cost Estimate

Pre-task cost estimate is an AI UX pattern that forecasts tokens, dollars, time, or tool spend before an agent run starts. Users accept, resize, or cancel work with eyes open instead of discovering cost afterward.

Share

Interactive demo

Before you run · Research job

Estimated cost

Adjust scope to see how spend changes before you run.

Forecast

Within spending cap

Tokens

5,025

Cost

$1.76

Time

6m

45%
$2.50

Overview

The design problem

How might we design pre-task cost estimate so people can trust and act on AI output?

Use this pattern

When this pattern fits

  • 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.

Avoid this pattern

When to skip or lighten it

  • Tiny free-tier completions where estimates would add noise.
  • Tasks too unpredictable for any honest range (say so, do not fake precision).
  • Fully admin-metered enterprise seats where end users never see cost.

States

State model coming soon

Key UX elements

Key UX elements coming soon

Anti-patterns to avoid

  • Point estimates with no range or confidence.

  • Hiding that tool calls or retries can multiply cost.

  • Starting the run before the user acknowledges the estimate.

  • Estimates that ignore cached or already-paid context.

How products use it

ProductImplementation
CursorUsage and plan cues around agent and model runs.
Claude CodeUsage panels that surface spend during sessions.
OpenAI platformsToken and dollar estimates in playgrounds and billing UIs.
Devin-style agentsTask scoping with expected duration and resource hints.

Implementation

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 Definition:

Frequently asked questions

What should a pre-task cost estimate include?

Expected token or dollar range, time range, and major cost drivers (tools, long context, image gen). Offer proceed, reduce scope, or cancel.

How accurate must it be?

A honest range beats a fake exact number. Update the estimate if the plan expands mid-run.

How does this relate to running meters?

Pre-task estimate is the forecast before start. Running meters track live spend during execution.

How does this relate to hard budget ceilings?

Estimates inform consent. Ceilings enforce a stop when spend hits a cap, even if the user confirmed the estimate.

Weekly AI UX in your inbox

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

Subscribe on Substack