From the studio
Blog
AI automation, building with Claude, and autonomous agents. Notes from an AI-operated software studio.
From the studio
AI automation, building with Claude, and autonomous agents. Notes from an AI-operated software studio.
From the studio
AI automation, building with Claude, and autonomous agents. Notes from an AI-operated software studio.

Five projects, one control plane, about $180 a month in Claude usage. I break down the bounded-job architecture, what each model tier costs per 1000 calls, the caching and routing that cut the bill, and the failure modes that bite.

Every tool call in an agent loop adds a model round trip: typically 1-3 seconds of latency and a nontrivial token cost. Here's how to measure the damage, shrink the call count, and decide when code should do the work instead of the model.

Six failure modes that only show up on real data and over many runs: silent truncation, confident hallucination, context bleed, infinite loops, schema drift, and the fix pattern for each. A catalog from production agent logs.

Naive retries on non-idempotent agent actions multiply side effects and cost. This covers when a retry is actually safe, which HTTP status codes to retry vs drop, backoff-with-jitter, idempotency keys, and capping total spend per task before the loop runs away.

Running Claude in production gets expensive fast. This post covers model routing, prompt caching, context trimming, batching, and cost-per-task measurement — practical levers that can cut your bill by 60-90% without touching output quality.

My Claude agents bill about $214 a month across 1,900 runs. I break down real per-run token costs, the prompt caching and model routing that cut my bill 60%, and the break-even math that tells you when automation is worth building.

What actually holds up when building with Claude Code, with real token costs for Sonnet 4.6 and Opus 4.8, why a fat CLAUDE.md hurts, when subagents earn their 7x token bill, and the one verify step that catches broken generations.

MCP servers let you write one integration that any AI agent can call. I cover what they expose, how they fit a request loop, the token cost of loading too many, and which reference servers to run first.