cd /news/ai-agents/where-the-time-actually-goes-in-an-a… · home topics ai-agents article
[ARTICLE · art-98032] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Where the time actually goes in an AI coding-agent job

Andréas, a full-stack developer and CTO at a B2B SaaS, measured the runtime of AI coding-agent jobs on his agent-orchestration platform and found that infrastructure overhead costs 5–8 minutes per job, accounting for 20–30% of total runtime. By pre-warming worktrees, enabling persistent caches, and optimizing I/O, he reduced fixed overhead to under 60 seconds, leaving model inference as the dominant cost.

read2 min views1 publishedAug 15, 2026

I run an agent-orchestration platform: it takes a ticket, spins up a git worktree, lets a Claude Code agent build the feature, and runs a deterministic verify gate before merging. A typical job takes 20–30 minutes.

I used to blame slow model responses for the runtime, but stage-by-stage measurements proved that assumption wrong: infrastructure overhead costs 5–8 minutes of every job before the agent even finishes.

Here is where the time actually goes and how to optimize it.

On a standard dev machine (Windows 11, Bun, Next.js), a single job pays a heavy infrastructure tax:

Stage Measured Cost Impact / Notes
git worktree add
Seconds Negligible overhead.
bun install
~91s (median)
Cold worktree setup, even with a warm cache.
Lint & Typecheck
~1–2 minutes
eslint + 2× tsc across the full repo with no shared cache.
next build
Minutes
The longest gate leg due to a cold .next directory every run.
Vitest
~26 seconds Fast and acceptable.
Model Time
~15–22 minutes Planning, execution, and review calls.

Fixed infrastructure costs account for 20% to 30% of total runtime. Eliminating this overhead reduces small job times from ~30 minutes to ~20 minutes, leaving the remaining time strictly bounded by model inference.

Instead of creating a fresh worktree and running bun install

from scratch for every job, maintain a small pool of pre-warmed directories containing: node_modules

directory (invalidated only when the lockfile hash changes)..next

, tsconfig.tsbuildinfo

, .eslintcache

).When a job starts, it claims a slot, checks out the target branch, and immediately executes. After completion, git clean

resets the worktree while leaving cache directories intact. This eliminates the ~91-second install step on almost every job.

Next.js supports persistent filesystem build caching. Combining this with a warm slot pool carries the .next

cache between jobs, turning the longest gate step from minutes into tens of seconds for standard diffs.

Adding --incremental to tsc

and --cache to eslint

within the persistent slot directory saves roughly 1 minute per job without changing verification outcomes.

Real-time Defender scanning severely throttles small-file I/O operations (like node_modules

and .next

writes). Adding directory exclusions or moving worktrees to a ReFS Dev Drive improves install and build I/O speeds by 2× to 5× with zero code changes.

Switching to bun install --linker isolated

provides pnpm-style symlinked stores, yielding faster warm installs. However, caution is required: symlinks spanning worktrees can cause catastrophic unintended deletions if cleanup commands traverse outside the worktree root.

`tsc --incremental`

and `eslint --cache`

.By optimizing the infrastructure pipeline, fixed job overhead drops from 5–8 minutes to under 60 seconds. The remaining runtime represents actual model reasoning—the exact phase worth waiting for.

I'm Andréas — full-stack dev, CTO at a B2B SaaS, building my own agent tooling. Portfolio: https://andreas-bodin.vercel.app

── more in #ai-agents 4 stories · sorted by recency
── more on @andréas 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/where-the-time-actua…] indexed:0 read:2min 2026-08-15 ·