← Working with a Coding Agent

What a Coding Agent Is Good At, and What It Isn't

By the end, you’ll be able to

  • Explain why an agent's confident wording is weakest as evidence where verification is thinnest
  • Sort your own work into what to hand to an agent and what to keep
  • Estimate your realistic speedup from how your week splits
  • Measure your own throughput instead of trusting how fast it feels

You should already know

For three months I counted my meaningful PRs: merged PRs I authored, leaving out dependency bumps and formatting-only changes. For the first six weeks I worked without AI tools and averaged 2.1 a working day. For the next six, with AI built into how I plan, implement and test, I averaged 7.8. Both averages are per working day (Monday to Friday), with days that had no merges counted as zero. It felt faster, and for once the count agreed with the feeling.

Then I read METR's randomized trial from early 2025 (Becker et al., "Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity", METR, July 2025, arxiv.org/abs/2507.09089). Sixteen experienced open-source developers worked through 246 real tasks in large, mature repositories they had contributed to for years, and each task was randomly assigned to either allow AI tools or forbid them. Before starting, the developers predicted AI would make them 24% faster. Afterwards they estimated it had made them 20% faster. The clock said they took 19% longer.

Both results can be true at once. They measured different things (my PR count, their time per task), on different work (my mix of endpoints, components, fixes and refactors, their deep work in codebases they knew by heart), and my count controlled for nothing: not PR size, not review time, not rework. The gap comes down to three questions you can ask about your own work: what was the agent confident about, what kind of work did it get, and what was actually measured?

It sounds just as sure either way

Same tone, different evidence
You
Your answer on the concurrency fix read exactly like your answer on the button colour. Same tone, same "this should resolve it".
Agent
That can happen. I can sound just as sure with a relevant check behind me as without one, so the tone on its own doesn't tell you which it was.
You
Then how do I tell which one you checked?
Agent
Look at what could have told me I was wrong. On the button, I ran the type checker and the component tests. Two of them failed, I fixed them, and you only saw the version that passed.
You
And the concurrency fix?
Agent
Two requests updating the same row at the same moment. An ordinary test run can easily miss that bug unless the test forces the two updates to interleave, and none of the tests I ran did. Nothing failed, so nothing changed my first answer. It sounds finished because nothing interrupted it.
You
So I should trust you less across the board?
Agent
Trust me where something checks me. Where nothing can, my confident answer is just my first guess, written up nicely.
The author
The confidence can sound the same while the checking doesn't. So the gap between how sure it sounds and what it verified can be widest exactly where verification was thinnest.

The word for how well confidence tracks being right is calibration, and you can't read it from an agent's tone. Its prose can sound just as sure about a renamed variable as about a lock-ordering change. What actually varies is feedback: a failing test, a type error, a build that breaks, a page that answers 404. Feedback gives the agent a chance to notice and fix a mistake before you see it, and often it does. That's a useful workflow, not a guarantee: agents also fail to fix a reported error, give up after a few unsuccessful attempts, or revise by rereading code without running anything. Where there's no feedback at all, nothing pushes back on a plausible first answer. Either way, look at which checks ran and what they actually cover.

So don't treat confident wording on its own as evidence of what the agent verified. The question to ask is "what could have told it that it was wrong?" If the answer is nothing, the confident answer is the one that needs most of your attention. Asking the agent how sure it is may tell you something, but a confidence statement on its own isn't evidence of correctness, and it isn't an independent check. Put checks you can see ahead of reassurance.

Sort the work by what can check it

In my tracking, the agent helped most on the blank page: boilerplate, new endpoints and components that follow an existing pattern, remembering an API signature, and test scenarios I wouldn't have thought of. With a plan as context, most of its first drafts on that kind of work needed only small fixes before I'd merge them. It barely helped with subtle race conditions, architectural trade-offs, and undocumented legacy code. There it was a research assistant at best: useful for suggesting where to look, while the judgment stayed mine.

What the first list has in common isn't that it's easy. It's that I could say what done looks like, and something other than me could check it. In the second list, at the start, nothing but my judgment could: a design trade-off has no test that says you were right, a race has to be reproduced and legacy code has to have its current behaviour pinned before a test can say anything. That's where the agent's confidence is least connected to anything.

Who gets the task

Start from the task and ask whether a relevant check exists that is strong enough to fail when the requirement isn't met. If it does, hand the task to the agent and let it run the check. If you can say what done looks like but no strong check exists yet, write the check first, which turns it into a hand-off. If you can't write the check yet, keep the task and use the agent to research: design trade-offs stay with you, and race conditions or undocumented legacy code often need investigation before a check can be written.

A task on your list
A relevant check exists and is strong enough to fail
Tests that exercise the actual requirement. A passing type check or a 200 response only counts if it would fail when the requirement isn't met.
Done is clear, but no strong check yet
You know what done looks like, but nothing would notice if it were wrong.
You can't write the check yet
Design trade-offs have no test that says you were right. Race conditions and undocumented legacy code often need investigation first: reproducing the bug, pinning current behaviour.
Hand it to the agent
It runs the check itself and fixes what fails before you review.
Write the check first, then hand it off
A failing test you wrote turns a keep into a hand-off.
Keep it; use the agent as a research assistant
Ask where to look and what the code does. Make the decision yourself. Once the investigation gives you a check, the task moves up a row.
  • A task on your list → A relevant check exists and is strong enough to fail: a relevant, strong check exists
  • A task on your list → Done is clear, but no strong check yet: done is clear, no strong check yet
  • A task on your list → You can't write the check yet: you can't write the check yet
  • A relevant check exists and is strong enough to fail → Hand it to the agent: agent gets feedback
  • Done is clear, but no strong check yet → Write the check first, then hand it off: you supply the feedback
  • You can't write the check yet → Keep it; use the agent as a research assistant: agent suggests, you decide

The middle row is where a lot of the value is. Writing the test yourself, before you hand anything over, moves a task from "keep" to "hand off". The METR paper lists factors that may have contributed to the slowdown, among them large, mature repositories, high quality bars, and a lot of context the developers carried in their heads. My interpretation, not the study's finding, is that conditions like these make strong checks harder to write and an agent's output more expensive to review, which may help explain the result.

Sharpen your pencil: sort five tasks
Put each task in one of the three rows: hand off, write the check first, or keep. 1. Add a GET /invoices/:id endpoint that follows the pattern of the three existing ones, with tests. 2. Decide whether to split the orders table into monthly partitions. 3. Fix a bug where two simultaneous withdrawals both succeed and overdraw the account. 4. Rename a prop across 40 React components in a TypeScript project. 5. Change how a ten-year-old billing module with no tests or docs rounds tax.
Show the answer
1. It depends on the tests. Hand off if checks for the new endpoint's own requirements already exist. A pattern to copy isn't enough on its own: if nothing yet tests what GET /invoices/:id must do, write the check first. 2. Keep. It's a trade-off with no test that can say you were right. Ask the agent for the options, then choose yourself. 3. Keep the diagnosis until you have a test that reproduces the double withdrawal. Once that test exists, hand it off: the agent can try fixes against it. 4. Hand off, but not to the compiler alone. The type checker catches many statically typed references, while optional props, prop spreads, any and untyped consumers can let a missed rename compile. Have the agent search for the old name as well, and run the component tests that cover those components. 5. Keep it at first. Find out what the module does today (the agent can help you look) and decide the new rounding rule yourself. Then write characterization tests that pin the current behaviour, plus tests for the new rule, and hand the implementation to the agent against those tests.

Estimate your speedup from how your week splits

If the agent speeds up the work you hand off, the work you keep still limits the overall gain, because it runs at your speed. My rough guess (an estimate, not a measurement) is that before I used an agent, 60% of my working time went to well-defined work and 40% to the hard part. The split has to be by time, not by tasks or PRs, for the arithmetic to hold. Suppose, hypothetically, the agent made that 60% five times faster, counting the prompting, checking and review the handed-off work now needs, and left the 40% unchanged. A week of work would then take 0.4 + 0.6 / 5 = 0.52 of the time, which is about 1.9x faster. Even if the hand-off work took no time at all, the 0.4 would remain, so the ceiling is 1 / 0.4 = 2.5x.

That's Amdahl's law, borrowed from parallel computing: the part you can't speed up sets the limit. Here it is as a script you can run with your own split. python speedup.py 0.6 5 prints 1.92x, and the optional third argument says how much slower the kept work gets.

speedup.py
import sys


1def overall_speedup(handoff_share, handoff_speedup, kept_slowdown=1.0):
    kept_share = 1 - handoff_share
2    new_time = kept_share * kept_slowdown + handoff_share / handoff_speedup
3    return 1 / new_time


if __name__ == "__main__":
    share = float(sys.argv[1])
    speedup = float(sys.argv[2])
    slowdown = float(sys.argv[3]) if len(sys.argv) > 3 else 1.0
    print(f"{overall_speedup(share, speedup, slowdown):.2f}x")
  1. handoff_share is a share of your working time before the agent, not of tasks or PRs.
  2. The kept work is paid in full, times any slowdown. This term sets the ceiling.
  3. Old time is 1, so the speedup is just the inverse of the new time.
Overall speedup when handed-off work gets 5x faster

With the hand-off work 5x faster and the kept work unchanged, the overall speedup is 1.19x when 20% of baseline working time is handed off, 1.47x at 40%, 1.92x at 60%, 2.78x at 80%, and only reaches 5x when everything is handed off.

Illustrative dataUnit: x faster overall

Categories are equally spaced in the supplied order.

LabelValue (x faster overall)
20% of time handed off1.19
40% of time handed off1.47
60% of time handed off1.92
80% of time handed off2.78
100% of time handed off5

Did I get 3.7x in time? I don't know. 3.7x is a ratio of PR counts, and I never timed the work. If my 60/40 estimate is accurate and the kept work took just as long as before, this arithmetic caps the time speedup at 2.5x. The count can rise without the time falling as much: smaller PRs, review and testing moved somewhere I didn't count, rework I didn't track. I controlled for none of those, which is why I report 3.7x as PR count and nothing more.

Sharpen your pencil: when the kept work slows down
Keep the 60/40 split and the 5x on hand-off work, but suppose the kept 40% gets 19% slower, because you're now prompting, waiting and reviewing on top of the hard thinking. What's the overall speedup? Work it out by hand, then check with speedup.py.
Show the answer
New time = 0.4 × 1.19 + 0.6 / 5 = 0.476 + 0.12 = 0.596, so about 1.68x. python speedup.py 0.6 5 1.19 prints 1.68x. Borrowing METR's 19% for the kept work is a simplification: they measured whole tasks, not the hard part of a week. The point stands, though. A slowdown on the work you keep eats into the gain from the work you hand off, and if most of your week is the hard part, you can end up slower overall.

Measure it, because it will feel faster

In METR's trial, the developers' average impression pointed in the opposite direction from the measured result, so I wouldn't rely on the feeling alone. One plausible reason is that working with an agent always looks busy: text streams in, files change, and waiting for output feels like progress. Whatever the cause, the fix is to count. The script below gets you the raw numbers for one repository between two dates: one row per calendar day with the PRs merged and lines changed (zero when nothing merged), then a total line that divides every PR merged in the range, weekend merges included, by the number of Monday-to-Friday days in it. That total is the per-working-day rate; if the range has no Monday-to-Friday days, the total line shows n/a instead of a rate. All dates are UTC, as GitHub records them, for both the date range and each row; if your working day runs past midnight UTC, a late merge lands on the next date, which can move it onto a weekend row or just outside your range. By default it counts every merged PR you authored. It also saves each PR's number, merge date and title to prs-FROM-TO.tsv. To match the rate I opened with, read through that file, put the numbers of the dependency bumps and formatting-only PRs in a text file, one per line, and run the script again with that file as a third argument. It drops those PRs before counting. Do this the same way in both periods. You need Bash, the GitHub CLI (gh) and jq 1.6 or newer. Sign in once with gh auth login, then run bash pr-throughput.sh FROM TO [EXCLUDE_FILE] from inside the repository you want to count.

pr-throughput.sh
#!/usr/bin/env bash
# Usage: bash pr-throughput.sh 2026-10-01 2026-10-31 [exclude.txt]
1# All dates are UTC, as GitHub records merge times.
2set -euo pipefail
from="$1"
to="$2"
3exclude="${3:-/dev/null}"
limit=1000

prs=$(gh pr list \
  --author "@me" \
  --state merged \
4  --search "merged:${from}..${to}" \
  --limit "$limit" \
  --json number,title,mergedAt,additions,deletions)

5if [ "$(jq length <<<"$prs")" -ge "$limit" ]; then
  echo "warning: hit the ${limit}-PR limit, so counts are incomplete. Split the date range." >&2
fi

6jq -r '.[] | [.number, .mergedAt[0:10], .title] | @tsv' <<<"$prs" > "prs-${from}-${to}.tsv"

jq -r --arg from "$from" --arg to "$to" --rawfile skip "$exclude" '
  ($skip | split("\n") | map(select(length > 0) | tonumber)) as $skipped
7  | map(select(.number as $n | ($skipped | index($n)) == null))
  | (reduce .[] as $pr ({}; .[$pr.mergedAt[0:10]] += [$pr])) as $byday
  | [range(($from | strptime("%Y-%m-%d") | mktime); ($to | strptime("%Y-%m-%d") | mktime) + 86400; 86400)] as $days
8  | ($days | map(select(gmtime | .[6] | . > 0 and . < 6)) | length) as $workdays
  | ($days[] | (todate[0:10]) as $day | ($byday[$day] // []) as $merged
9    | [$day, ($merged | length), ($merged | map(.additions + .deletions) | add // 0)] | @tsv),
10    "total\t\(length) PRs / \($workdays) working days = \(if $workdays > 0 then "\(length / $workdays * 100 | round / 100) per working day" else "n/a (no working days in range)" end)"
' <<<"$prs"
  1. GitHub search and mergedAt both use UTC, so a merge late in your evening can count toward the next date.
  2. With set -e and pipefail, a failing gh stops the script instead of jq happily printing nothing.
  3. Optional file of PR numbers to leave out, one per line. Without it, nothing is excluded.
  4. GitHub search syntax: merged inside the date range. Run it from inside the repo you want to count.
  5. gh returns at most limit PRs. If you hit the cap, the counts are incomplete: split the range into smaller windows that don't overlap and combine them.
  6. Saves one line per PR (number, merge date, title) so you can pick out the dependency bumps and formatting-only changes to exclude.
  7. Drops the excluded PR numbers before anything is counted.
  8. Monday to Friday only, and only for the denominator. Weekend merges still count in the total.
  9. One row per calendar day, weekends included: date, PRs merged, lines added plus deleted. Zero when nothing merged.
  10. Every PR in the range divided by working days. This is the number to compare with the opening rate. A weekend-only range has no working days, so it prints n/a rather than dividing by zero.

The count is where you start, not the whole answer. Line counts show whether your PRs just got smaller. Beside them, keep a short log by hand: the task type, and whether that PR needed a revert or a follow-up fix within a week. Compare two periods of similar work, not a feature month against a bug-fix month. If you want the honest version, do what METR did on a small scale: for similar tasks, decide by coin flip whether to use the agent, write down your estimate, and time it.

  1. Pick a tasksimilar size to the others
  2. Flip a coinagent or no agent
  3. Write your estimatebefore you start
  4. Work and time itincluding review
  5. Check a week laterreverts, follow-up fixes
Ten tasks won't make a study. They can catch a large gap between your feeling and your clock and work as a first sanity check, but with so few tasks a coin flip won't balance difficulty, and the result may well be inconclusive.
There are no dumb questions
Q: Does METR's result prove AI tools make developers slower?
A: No. It's 16 developers, early-2025 tools, and mature codebases they knew deeply. What it shows well is that experienced people can't feel the difference reliably, which is the reason to measure.
Q: Then does your 3.7x prove they make you faster?
A: No, not on its own. It's one developer's uncontrolled PR count. It's a reason for me to keep measuring, not a number you should expect.
Q: Should I stop using the agent on the hard 40%?
A: Use it differently. Ask it where a bug might be, what an old module does, or for the options on a design. Don't hand it the decision, and treat its explanation of legacy code as a lead to check, not a fact.
Q: What counts as a check?
A: Anything that fails loudly without you watching: tests, the type checker, the linter, the build, a request that returns the wrong status. Checks can lie too. A type check that prints an error and still exits 0 is one of the cases in Lesson 4.
Q: Can't I just ask the agent how confident it is?
A: You can, and the answer may carry some signal, but it isn't independent verification. Ask what it ran and to show the output, and weigh that above any reassurance.
Bullet points
  • An agent can sound equally sure whether it checked or not, so confident wording is weakest as evidence where feedback is thinnest.
  • Ask "what could have told it that it was wrong?" If the answer is nothing, review hardest there.
  • Hand off work that has a relevant check strong enough to fail when the requirement isn't met. Keep design trade-offs, and investigate race conditions and undocumented legacy code until you can write that check.
  • Writing the test first turns a task you'd keep into one you can hand off.
  • Your overall speedup is capped by the work you keep: with 40% of your time kept, the ceiling is 2.5x however fast the agent is.
  • If the kept work gets slower, the overall gain shrinks and can turn into a loss.
  • How fast it feels is not evidence. Count PRs, lines changed and rework, or time a coin-flip experiment.

Cite this lesson

Mohamed Hosny, “What a Coding Agent Is Good At, and What It Isn't”, Working with a Coding Agent, www.mohamed-hosny.dev, . https://www.mohamed-hosny.dev/tutorials/working-with-a-coding-agent/what-a-coding-agent-is-good-at

Referencing this? Please credit Mohamed Hosny and link to the original page.

That’s the end of Working with a Coding AgentBack to all tutorials