fcakyon/claude-codex-settings / plugins/cloudflare-skills/skills/agents-sdk
agents-sdk
VerifiedBuild, debug, or review Cloudflare Agents SDK applications using the agents package.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.0 KB |
| references/browse-the-web.md | markdown | 1.6 KB |
| references/callable.md | markdown | 2.1 KB |
| references/client-sdk.md | markdown | 1.2 KB |
| references/codemode.md | markdown | 2.8 KB |
| references/configuration.md | markdown | 1.8 KB |
| references/durable-execution.md | markdown | 1.7 KB |
| references/email.md | markdown | 3.5 KB |
| references/human-in-the-loop.md | markdown | 929 B |
| references/mcp.md | markdown | 1.3 KB |
| references/observability.md | markdown | 1.3 KB |
| references/queue-retries.md | markdown | 1.4 KB |
| references/routing.md | markdown | 1.8 KB |
| references/server-driven-messages.md | markdown | 868 B |
| references/skill-feedback.md | markdown | 2.7 KB |
| references/state-scheduling.md | markdown | 1.5 KB |
| references/streaming-chat.md | markdown | 1.4 KB |
| references/think.md | markdown | 2.9 KB |
| references/voice.md | markdown | 1.9 KB |
| references/webhooks-push.md | markdown | 2.4 KB |
| references/workflows.md | markdown | 2.3 KB |
references/observability.md
View on GitHub# Observability
Fetch https://developers.cloudflare.com/agents/runtime/operations/observability/index.md for complete documentation.
Agents emit structured events via Node.js `diagnostics_channel`. Subscribe in development or forward via Tail Workers in production.
## Subscribe to Events
```typescript
import { subscribe } from "agents/observability";
subscribe("agents:rpc", (event) => {
console.log(`RPC call: ${event.payload.method}`);
});
subscribe("agents:state", (event) => {
console.log(`State change on ${event.agent}`);
});
```
## Available Channels
| Channel | Events |
|---------|--------|
| `agents:state` | State changes |
| `agents:rpc` | `@callable` invocations |
| `agents:message` | WebSocket messages |
| `agents:schedule` | Schedule triggers |
| `agents:lifecycle` | Agent start, connect, disconnect |
| `agents:workflow` | Workflow progress, completion, errors |
| `agents:mcp` | MCP server connections, tool calls |
| `agents:email` | Email received |
## Per-Agent Override
```typescript
export class MyAgent extends Agent<Env, State> {
observability = undefined; // disable for this agent
}
```
## Production: Tail Workers
In production, events appear as `diagnosticsChannelEvents` on the Tail Worker `event` object. Attach a Tail Worker to your agent's Worker to forward events to your observability platform.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |