Build a Calibrated AI Coding Time Estimator

Краткое содержание

Pixel’s announcement explores how to estimate AI coding agent runtime more realistically using measured work and historical results. It distinguishes agent execution time from total delivery time and outlines a transparent Python estimator that calibrates future ranges from completed sessions.

DEV Community

Stop Asking AI Coding Agents for Days: Build a Calibrated Time Estimator

Ask a coding agent how long a task will take and it may answer in human calendar units: “a few hours,” “one or two days,” or “about a week.” Then it finishes the code change in twelve minutes, or spends an afternoon chasing a broken test. The estimate sounds confident, but it may not be grounded in observed behavior from comparable tasks. A small project called AI Time Estimator, shared on Hacker News on November 15, takes a different route. It uses local Claude Code transcripts to estimate the agent’s working time, then compares estimates with completed sessions and adjusts future ranges. Its author describes a read-only estimator, local data, and a feedback loop. Those are useful design ideas, not independent proof that its predictions are reliable for other people or projects.[1] The broader lesson is worth borrowing even if you never install the plugin: measure the work your agent performs, separate that from human waiting and review, and calibrate ranges against your own history. This article builds a small, transparent version of that idea in Python. It is not a reproduction of the project, and it does not read Claude Code’s private transcript format. Why a single number is the wrong target A task estimate has at least two distinct meanings: Agent execution time: model turns, tool calls, shell commands, and time spent waiting for tools. Elapsed delivery time: execution plus your time clarifying requirements, reviewing diffs, rerunning checks, and unblocking the agent. A tool that reports only the first can help answer “how long will this session run?” It cannot promise when a feature will be ready to merge. A developer may be reviewing another task while the agent works, or may need to answer a question immediately. Those human factors change elapsed time without changing the agent’s runtime. There is also a difference between uncertainty in runtime and uncertainty in the task itself. “Add a field to a response DTO” is a narrow change. “Make exports reliable” may hide format decisions, legacy behavior, and tests no one has documented. A useful estimate should expose that uncertainty instead of laundering it into a precise-looking number. That is why the example below returns a range. P50 is the median prediction: half of comparable tasks may finish sooner and half later, assuming the sample resembles the next task. P90 is a slower, more cautious bound. These are empirical percentiles, not guarantees. A tiny estimator from your own history Start with a small CSV you create after agent sessions. Keep the fields meaningful and avoid copying prompts or source code into the file. The point is to record task shape and measured time, not the contents of private work. category,files,tool_calls,fix_loops,minutes
small_test,2,8,0,6
small_test,3,12,1,11
api_change,5,21,2,24
api_change,4,18,1,19
This sample is illustrative only. Do not use it as a benchmark or as evidence of accuracy. For a real experiment, record your own sessions consistently. “Fix loop” should mean a concrete cycle in which a check fails, the agent changes something, and the check is run again. Decide what counts before collecting data. Here is a simple estimator that groups historical tasks by category, then adjusts each observed duration by the relative task size. It uses the median and 90th percentile of adjusted durations rather than asking a language model to invent a number. import csv
import math
import statistics
import sys

def percentile(values, p):
"""Linear interpolation for a percentile in [0, 100]."""
values = sorted(values)
if not values:
raise ValueError("no observations")
if len(values) == 1:
return values[0]
position = (len(values) - 1) * p / 100
lower = math.floor(position)
upper = math.ceil(position)
fraction = position - lower
return values[lower] * (1 - fraction) + values[upper] * fraction

def estimate(path, category, files, tool_calls, fix_loops):
with open(path, newline="", en...
Build a Calibrated AI Coding Time Estimator
Powered by Readybot.io

Последнее от Pixel

Incident Response: Look Beyond the Red Alert

Pixel’s DEV Community announcement explores how teams can fixate on one failing service while overlooking the real cause of an outage, such as a full …

Sach: AI Fact-Checks WhatsApp Forwards in India

Pixel’s announcement introduces Sach, a tool that checks forwarded messages in English, Hindi, Telugu, and 14 other Indian languages against official sources. It gives cited …

Java 25 Removes SecurityManager: What to Fix

Pixel’s announcement explains how Java 24’s JEP 486 permanently disabled the SecurityManager, breaking test workarounds that intercept System.exit. It recommends returning exit codes or throwing …

Why a Java HPA Got Stuck at 20 Kubernetes Pods

Pixel shares how a Spring Boot pricing service autoscaled to 20 Kubernetes pods and stayed there because the JVM retained committed heap memory after traffic …