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/durable-execution.md
View on GitHub# Durable Execution
Fetch https://developers.cloudflare.com/agents/runtime/execution/durable-execution/index.md for complete documentation.
Fibers let agent work survive Durable Object eviction. Progress is checkpointed to SQLite; on recovery, you decide what to do.
## `runFiber`
```typescript
export class MyAgent extends Agent<Env, State> {
async onRequest(request: Request) {
await this.runFiber("process-data", async (ctx) => {
const step1 = await fetchData();
ctx.stash({ step: 1, data: step1 });
const step2 = await transform(step1);
ctx.stash({ step: 2, result: step2 });
this.setState({ result: step2 });
});
return new Response("Started");
}
async onFiberRecovered(ctx) {
const checkpoint = ctx.stash;
if (checkpoint.step === 1) {
const step2 = await transform(checkpoint.data);
this.setState({ result: step2 });
}
}
}
```
## Key APIs
| API | Purpose |
|-----|---------|
| `this.runFiber(name, fn)` | Start a named fiber |
| `ctx.stash` / `this.stash` | Read latest checkpoint |
| `ctx.stash = data` | Write checkpoint (JSON-serializable) |
| `onFiberRecovered(ctx)` | Called on DO restart if fiber was in-flight |
| `keepAlive()` | Prevent hibernation while fiber runs |
| `keepAliveWhile(fn)` | Keep alive for duration of async function |
## Important
- `stash` replaces the entire checkpoint — not a merge
- The lambda is NOT restored on recovery — only the stash data is. You must re-derive what to do in `onFiberRecovered`
- No auto-retry on throw — handle errors yourself
- For long-running pipelines with automatic retries, use Workflows instead
- Filter concurrent fibers by `ctx.name` in `onFiberRecovered`
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: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | 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 |