# Durable Objects

Build, debug, or review Cloudflare Durable Objects code for persistent state and...

- Repository: https://github.com/cloudflare/skills (3246 stars)
- Category: Testing
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add cloudflare/skills --skill durable-objects -g -a claude-code -y`
Codex: `npx skills add cloudflare/skills --skill durable-objects -g -a codex -y`
Cursor: `npx skills add cloudflare/skills --skill durable-objects -g -a cursor -y`
Gemini CLI: `npx skills add cloudflare/skills --skill durable-objects -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add cloudflare/skills`

## Description

Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Durable Objects

Build stateful, coordinated applications on Cloudflare's edge using Durable Objects.

## Retrieval Sources

Your knowledge of Durable Objects APIs and configuration may be outdated. **Prefer retrieval over pre-training** for any Durable Objects task.

| Resource | URL |
|----------|-----|
| Docs | https://developers.cloudflare.com/durable-objects/index.md |
| API Reference | https://developers.cloudflare.com/durable-objects/api/index.md |
| Best Practices | https://developers.cloudflare.com/durable-objects/best-practices/index.md |
| Examples | https://developers.cloudflare.com/durable-objects/examples/index.md |
| Roles and permissions | https://developers.cloudflare.com/workers/authorization/durable-objects/index.md |

Fetch the relevant doc page when implementing features.

## When to Use

- Creating new Durable Object classes for stateful coordination
- Implementing RPC methods, alarms, or WebSocket handlers
- Reviewing existing DO code for best practices
- Configuring wrangler.jsonc/toml for DO bindings and migrations
- Writing tests with Cloudflare’s Vitest integration
- Designing sharding strategies and parent-child relationships

## Reference Documentation

- `./references/rules.md` - Core rules, storage, concurrency, RPC, alarms
- [Testing reference](./references/testing.md) - Current Vitest documentation, migration choices, and test selection
- [Workers reference](./references/workers.md) - Workers handlers, types, configuration, tracing, and local debugging

Search: `blockConcurrencyWhile`, `idFromName`, `getByName`, `setAlarm`, `sql.exec`

## Core Principles

### Use Durable Objects For

The rest: https://github.com/cloudflare/skills/blob/HEAD/skills/durable-objects/SKILL.md
