On the day the billing change took effect, I added per-stage cost metering to my headless runs
The June 15 billing change moved headless runs and agent delegation onto monthly credits. Here is a thin metering layer that records token usage per stage tag from response.usage and emits a daily cost report, with working code.
Making Claude Agent SDK Tools Idempotent — Stopping Double Execution with Deterministic Keys and an Outbox
An implementation log for stopping a Claude Agent SDK retry or session resume from processing the same payment twice. Three patterns — deterministic idempotency keys, an outbox, and a lightweight wrapper — with runnable code and production metrics.
Implementing the Saga Pattern in Claude Agent SDK — Compensating Transactions and Idempotency
A practical guide to building safe multi-step Claude Agent SDK workflows. We cover compensating transactions, idempotency keys, and partial-failure state recovery, all from patterns that have run in production.
Implementing the Transactional Outbox Pattern with Claude Agent SDK — Eliminating Lost Side Effects in Production
Stop the 'the row was inserted but the email never went out' class of bugs in Claude Agent SDK apps. A production-grade walkthrough of the Transactional Outbox pattern using Postgres and Cloudflare Queues.
Shadow Mode with Claude Agent SDK — Measuring Agent Accuracy on Live Traffic Without Touching Users
You want to ship an AI agent to production, but you can't measure its real accuracy without exposing real users. Shadow mode solves that paradox. This guide shows how to run a Claude Agent SDK agent alongside your existing workflow, log the deltas, and promote it step by step.
Implementing Progressive Delivery with the Claude Agent SDK: Canary, Feature Flags, and Automatic Rollback Patterns for Production
Production-grade patterns for safely rolling out AI agents built with the Claude Agent SDK. Combines canary traffic splitting, feature flags, and SLO-driven automatic rollback with runnable TypeScript/Hono implementation code.