agentleFS
CloudflareKnown publishercloudflare/agents/design/AGENTS.md

agents / design

AGENTS.md5.8k starsChanged 5 months agoMITView on GitHub

Internal design records — the "why" behind decisions in this repo and its libraries. This is the Diátaxis explanation quadrant: architecture rationale, tradeoffs, and alternatives considered. Living documents that describe how a concept or subsystem works right now. Named by topic: state.md, mcp.md, visuals.md. These are the primary entry point — a contributor looking for "how does state work" should open one file and get the full picture. Design docs get updated as the implementation evolves. They always reflect the…

Trending

More talk lately.about the whole repository

Dec 2025: 2 mentionsJan 2026: 3 mentionsFeb 2026: 10 mentionsMar 2026: 4 mentionsApr 2026: 2 mentionsMay 2026: 2 mentionsJun 2026: 2 mentionsJul 2026: 2 mentionsAug 2026: 1 mentionSep 2026: 3 mentionsOct 2026: 3 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the cloudflare/agents repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about cloudflare/agents

The biggest 5 of 43 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 43

Talked about on GitHub, Bluesky and Hacker News (43 times).

On GitHub · 33

28 more on GitHub

On Bluesky · 9

4 more on Bluesky

On Hacker News · 1

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No strict template. Each file should at minimum cover:

    line 56
  2. Distinctive:

    Keep it concise. A few paragraphs is fine.

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — design/

Internal design records — the "why" behind decisions in this repo and its libraries. This is the Diátaxis explanation quadrant: architecture rationale, tradeoffs, and alternatives considered.

Two kinds of document

Design docs

Living documents that describe how a concept or subsystem works right now. Named by topic: state.md, mcp.md, visuals.md. These are the primary entry point — a contributor looking for "how does state work" should open one file and get the full picture.

Design docs get updated as the implementation evolves. They always reflect the current reality.

RFCs

Point-in-time decision records for significant changes. Named with an rfc- prefix: rfc-state-v2-sync-protocol.md. These capture why a specific change was made and what alternatives were considered. They do not get updated after the decision — they are snapshots.

RFCs are never deleted, even after rejection. Rejected RFCs are valuable — they prevent re-litigating the same idea later.

Workflow

1. Propose:  write rfc-<name>.md (status: proposed)
2. Decide:   update status to accepted or rejected
3. Implement: update the relevant design doc to reflect the new reality
              (create one if it does not exist yet)

Step 3 is important — the design doc is what people read day-to-day. The RFC is the footnote explaining one particular decision within it.

A design doc may link to multiple RFCs that shaped it over time:

## History

- [rfc-state-sync.md](./rfc-state-sync.md) — original bidirectional sync design
- [rfc-state-v2-batching.md](./rfc-state-v2-batching.md) — added batched updates

RFC format

Include a status line at the top:

Status: proposed | accepted | rejected

Then cover:

  • The problem — what we need to solve
  • The proposal — what we want to do
  • The alternatives — what else we considered and why not
  • The decision — what was decided (filled in after discussion)

Design doc format

No strict template. Each file should at minimum cover:

  • How it works — the current design, kept up to date
  • Key decisions — link to relevant RFCs for the reasoning
  • Tradeoffs — what we gave up and why

Keep it concise. A few paragraphs is fine. These are records, not essays.

What does not belong here

  • API reference or usage guides — those go in /docs (see /docs/AGENTS.md)
  • Code comments — keep inline explanations in the code itself
  • Changelogs — those live in package CHANGELOG.md files

Current contents

FileTypeScope
alarm-coordination.mddesign docLifecycle-owned physical alarm, capability contributions, Scheduler, and Agent adaptation
chat-shared-layer.mddesign docChat shared layer — streaming, reconciliation, recovery, protocol, and the shared React hook in agents/chat
durable-streams-comparison.mdanalysisDurable Streams (ElectricSQL) vs the Agents SDK — layer mapping, what each has, strategic takeaways
think.mddesign docThink — current design: composition, turn pipeline, persistence, recovery, wire protocol, tools, tables
sessions.mddesign docagents/sessions design record: schema, write economics, attachments, maintenance
think-vs-aichat.mddesign docThink vs AIChatAgent — current differences, when to use each, code comparisons
think-roadmap.mddesign docThink implementation plan — all 5 phases complete, full AIChatAgent parity
chat-api.mdanalysisAIChatAgent + useAgentChat API analysis — pain points, improvements, Think influence
chat-improvements.mddesign docStatus record for the ai-chat improvement plan — what shipped, what did not, where it lives
readonly-connections.mddesign docReadonly connections — enforcement, storage wrapping, caveats
retries.mddesign docRetry system — primitives, integration points, backoff strategy, tradeoffs
visuals.mddesign docUI component library (Kumo), dark mode, custom patterns, routing integration
workspace.mddesign docWorkspace — hybrid SQLite+R2 filesystem, bash, symlinks, observability
agent-tools.mddesign docAgent tools — chat sub-agent orchestration, parent registry, event replay
sub-agent-routing.mddesign docSub-agent routing as shipped — facets, nested URLs, registry, parent lookup, caveats
rfc-sub-agents.mdRFCSub-agents — child DOs via facets, typed stubs, built into Agent (accepted)
rfc-sub-agent-routing.mdRFCSub-agent external addressability — nested URLs, onBeforeSubAgent, per-call bridge
rfc-helper-sub-agent-orchestration.mdRFCAgent tool orchestration — runAgentTool, agentTool, event forwarding
rfc-detached-agent-tools.mdRFCDetached ("background") agent-tool runs — detached mode, durable named-method completion hook
rfc-think-multi-session.mdRFCFacet-backed Chats base-class pattern (rejected; replaced by rfc-user-chat-durable-objects)
rfc-user-chat-durable-objects.mdRFCOne user hub plus one independent top-level Durable Object per chat (accepted)
rfc-chat-recovery-work-budget.mdRFCDecouple chat-recovery duration from the runaway guard — work budget + shouldKeepRecovering (accepted)
rfc-chat-recovery-foundation.mdRFCShared chat recovery foundation — internal engine, adapters, behavior convergence, and testing strategy
rfc-ai-chat-maintenance.mdRFCAIChatAgent first-class stance, shared chat toolkit, multi-session example direction
loopback.mddesign docLoopback pattern — cross-boundary RPC for sub-agents and dynamic isolates
worker-bundler.mddesign docWorker bundler — host-side assets, no code generation, mounting is caller's concern
rfc-workers-ai-gateway-merge.mdRFCMerge ai-gateway-provider into workers-ai-provider — registry routing, universal run API, resume (proposed)
rfc-coding-agent.mdRFCCodingAgent — new @cloudflare/coding-agent package (extends AIChatAgent), CLI coding agents in Sandbox, pluggable engine (Cli/Harness), two-lifecycle durability (proposed)
rfc-codex-harness-capability.mdRFCStatic Codex Rust/Wasm turn engine composed onto a plain Durable Object as a Lifecycle capability (proposed)
rfc-harness-model-provider-boundary.mdRFCKeep model providers native per harness in v1: LanguageModelV4 for Codex and pi-ai providers for Pi (proposed)
test-coverage-matrix.mddesign docFeature × test-layer coverage rollup, CI→layer mapping, skipped-test debt, nightly hygiene
mcp.mddesign docStateless, Legacy compatibility, Legacy sessionful, client, package boundary, and conformance architecture
durable-object-lifecycle.mddesign docLifecycle Objects, capability and host phases, Scheduler/alarm ownership, host context, identity, and always-hibernating WebSockets
rfc-durable-object-lifecycle.mdRFCConstructor-composed Durable Object lifecycle with reusable components and always-hibernating WebSockets
rfc-cold-rpc-initialization.mdRFCCold native RPC runs lifecycle startup from the Agent context wrapper for async methods; sync methods stay sync (accepted)
rfc-fibers.mdRFCTasks (née Fibers) — durable replayable execution as one Lifecycle capability: named definitions, journaled steps, sleeps, optional recovery callback (accepted, amended)
rfc-streams.mdRFCStreams — durable incremental output as a Lifecycle capability: chunk log, cursor, replay-then-tail reads, composed with Tasks via checkpointed cursors (proposed)
rfc-pi-harness-example.mdRFCpi-durable as an example-local Lifecycle capability with a per-session wake job and a pi session store; what must land before it becomes a package export (proposed)
rfc-self-modifying-harness.mdRFCEditable harness source in Workspace, activation through Worker Bundler, and one fresh Dynamic Worker per turn (proposed)
browser-sessions.mddesign docPersistent Browser behind browserTool — one browser per object, reattach-or-create, restart signaling

Relationship to /docs

/docs is user-facing ("how to use the SDK"). /design is contributor-facing ("why the SDK works this way"). If a design decision affects how users interact with the SDK, distil the user-relevant parts into a doc in /docs and link back here for the full rationale.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.