Cloudflare gives coding agents local tracing for Workers
Wrangler and the Vite plugin now auto-capture OpenTelemetry traces for local Worker runs and expose them to coding agents via the Local Explorer API — no SDK, no config, no prompt hints needed.

Cloudflare has quietly made its local Workers tooling a lot more useful for AI coding agents. As of today, wrangler dev and vite dev automatically capture OpenTelemetry traces for every local Worker invocation. When the dev server detects an agent session, it points the agent at the Local Explorer API — a local debugging endpoint where traces and correlated logs can be queried with SQL. No SDK, no tracing config, no agent setup, no mention of observability in the prompt.
The workflow is dead simple. An agent starts the dev server, reproduces the bug, then hits the read-only observability endpoint to pull the trace. The trace shows exactly which binding failed and why. In the example Cloudflare walks through, a POST /api/orders endpoint starts returning 500 after a schema change. Without traces, the agent would add logs around KV, D1, and the Queue, rerun, inspect, repeat — burning tokens and time. With traces, it sees in one query that the KV read succeeded, the D1 insert failed with no such column: delivery_window, and the Queue was never called. The agent then inspects the D1 schema via the API, finds the missing migration, applies it, and verifies the fix — all in a single local loop, no deploy required.
How it works under the hood
The instrumentation lives in workerd, the open-source runtime that powers Workers. It captures spans for outbound fetch calls, binding interactions (KV, R2, D1, Durable Objects, Queues), and handler lifecycles — plus any custom spans your app emits. Miniflare collects runtime events and console output, assembles them into OpenTelemetry traces, and stores them in a SQLite-backed Durable Object that serves as the local trace store. The Local Explorer API exposes that data through the dev server.
Agents discover the API automatically because the root serves an OpenAPI schema — no hardcoded endpoint paths needed. Humans can also browse the same data in the browser-based Local Explorer, which runs on the same localhost origin as the Worker (press e in Wrangler or visit /cdn-cgi/explorer).
To get started, update Wrangler or the Cloudflare Vite plugin and just ask your agent to debug locally. The agent can already write and run your Worker — now it can see what happened, fix it, and verify the result before you deploy.
Your agent can already write and run your Worker locally — now it can see what happened, fix what failed, and verify the result before you deploy.