Local Worker failures now come with automatic traces for coding agents
Cloudflare has made local tracing available by default for coding agents. wrangler dev and vite dev now automatically capture OpenTelemetry traces for local Worker invocations, and when the tooling detects an agent session, it advertises the Local Explorer API—a local debugging endpoint where the agent can queried those traces. No SDK installation, feature flag, agent configuration, or observability mention in the prompt is required.
This is an extension of Cloudflare's local development tooling, building on Miniflare and the decision to make local mode the default in Wrangler 3. Local traces give an agent structured feedback from the real local runtime before anything is deployed.
A prompt as short as:
POST /api/orders is returning 500. Find the cause, fix it, and verify the fix locally.
will let the agent find and use the telemetry on its own.
How agents find the API
An agent typically starts wrangler dev or vite dev to exercise a Worker. When the development server recognizes a supported agent session, it prints a hint directing the agent to the Local Explorer API:
This dev session is running in an AI agent.
The Local Explorer API is available at
http://localhost:8787/cdn-cgi/explorer/api
...
Debug with traces:
POST /cdn-cgi/explorer/api/local/observability/query -- query traces and logs with SQL
The Local Explorer is both a browser-based UI and a REST API for inspecting and editing local resource data during development. The API root exposes an OpenAPI schema, meaning an agent can discover available endpoints at runtime rather than relying on hardcoded instructions. Traces are served through a read-only observability endpoint, with console logs correlated to each trace. Agents can also use other API operations to inspect local Workers, bindings, and state held in D1, KV, R2, Durable Objects, and Workflows.
One loop to diagnose and fix
Consider a POST to /api/orders that reads an active cart from KV, inserts checkout details into D1, and sends a message to a Queue. After a schema change, the endpoint starts returning 500s.
Without local traces
The 500 gives no indication of which operation failed. The agent must scatter logs around KV, D1, and the Queue, rerun the request, inspect the output, and repeat—a slow loop that burns tokens while the agent reconstructs each request from text.
With local traces
The agent reproduces the error and queries the read-only observability endpoint. The trace shows that the KV read succeeded, the D1 insert failed with no such column: delivery_window, and the Queue was never invoked.

The agent then inspects the D1 schema via the Local Explorer API, discovers that the migration for delivery_window exists in the repository but hasn't been applied locally, applies it, resends the request, and checks the trace for the new invocation. The workflow ends cleanly: in one local loop, the agent identified the failing operation, repaired the local environment, and verified the fix—no deployment and no temporary logging.
Human-visible traces in the same place
Agents talk to the API, but developers can use the Local Explorer UI to view the same telemetry. It runs on the same localhost origin as the Worker—not in the Cloudflare dashboard. Press e in Wrangler or open /cdn-cgi/explorer to see spans, timing, attributes, errors, and correlated console logs for any request, in addition to browsing binding state.

Instrumentation without code changes
Cloudflare previously built tracing instrumentation directly into workerd, the open-source runtime behind Workers, when it launched Workers Tracing. That instrumentation is available locally because Wrangler and the Cloudflare Vite plugin use Miniflare to run Workers in the same runtime. The runtime captures spans for:
- Fetch calls: Outbound HTTP requests, including timing, status codes, and metadata.
- Binding calls: Operations against KV, R2, D1, Durable Objects, Queues, and other bindings.
- Handler calls: The full lifecycle of each invocation—
fetch,scheduled, or queue handlers.
Application-emitted custom spans appear alongside those automatic spans. Miniflare takes the runtime events and console output, assembles them into OpenTelemetry traces with correlated logs, and writes them to an internal SQLite-backed Durable Object that acts as the local trace store. The Local Explorer API surfaces that store to both agents and developers.
Getting started
Update Wrangler or the Cloudflare Vite plugin, depending on your project:
# Wrangler
npm install --save-dev wrangler@latest
# Cloudflare Vite plugin
npm install --save-dev @cloudflare/vite-plugin@latest
Then ask your coding agent to debug locally as usual. It can already write and run Worker code locally—now it can also see what happened, fix what failed, and verify the result prior to deploy. See the official docs for more on the API.



