Skip to content
mentoor

Measuring and controlling agent cost

For engineers

Measuring tokens per task, matching models to work, using caching and setting budgets for coding agents

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

Where do most tokens in a long coding-agent session usually come from?

Choose one answer

Check yourself · 2 of 5

Which step is the best candidate for a small, fast model at low effort?

Choose one answer

Check yourself · 3 of 5

For prompt caching to work, which part of a request must stay identical between turns?

Choose one answer

Check yourself · 4 of 5

When should you start a fresh agent session?

Choose one answer

Check yourself · 5 of 5

What happens when a developer on a subscription plan reaches the plan's usage cap?

Choose one answer

Topics

  1. Measuring tokens and cost per agent task5 min read · Session cost readouts, usage dashboards and where agent tokens really go: file reads, tool output and retries
  2. Matching model and reasoning effort to the task5 min read · Small fast models for search and simple edits, strong models for planning and review, and effort settings
  3. How prompt caching cuts agent cost5 min read · Stable prefixes, cache hits on long sessions, and edits to memory files or tool lists that break the cache
  4. Cutting token waste in long agent sessions5 min read · Clearing between tasks, trimming huge tool output, targeted file reads and fewer always-loaded tools
  5. Budgets, rate limits and spend alerts5 min read · Subscription caps versus API billing, workspace spend limits, per-user budgets and alerts before the bill arrives

Start here

110 questions · last verified 2026-12