Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/cloudflare/agents/getting-startedgit clone --depth 1 https://github.com/cloudflare/agentsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01962 |
| Opus 5 | $0.00000 | $0.00981 |
| Sonnet 5 | $0.00000 | $0.00392 |
| Haiku 4.5 | $0.00000 | $0.00196 |
Grade A, and why
getting-started scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
async fetch(request: Request, env: Env, ctx: ExecutionContext) { How it starts
The opening of the file, as written. The whole thing — 306 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Getting Started
Build AI agents that persist, think, and act. Agents run on Cloudflare's global network, maintain state across requests, and connect to clients in real-time via WebSockets.
What you'll build: A counter agent with persistent state that syncs to a React frontend in real-time.
Time: ~10 minutes
Create a New Project
npm create cloudflare@latest -- --template cloudflare/agents-starter
cd my-agent
npm install
This creates a project with:
src/server.ts- Your agent codesrc/client.tsx- React frontendwrangler.jsonc- Cloudflare configurationtsconfig.json- Extendsagents/tsconfigfor correct decorator and module settingsvite.config.ts- Includes theagents/viteplugin for decorator support
The starter template includes two SDK integrations that are required for @callable() decorators. If you are setting up a project manually, add both:
tsconfig.json — extends agents/tsconfig, which sets target: "ES2021" and other recommended options:
{
"extends": "agents/tsconfig"
}
vite.config.ts — includes the agents() plugin, which handles TC39 decorator transforms (required because Vite 8's Oxc transpiler does not support them yet):
import { cloudflare } from "@cloudflare/vite-plugin";
import react from "@vitejs/plugin-react";
import agents from "agents/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [agents(), react(), cloudflare()]
});
Start the dev server:
npm run dev
Open http://localhost:5173 to see your agent in action.
Your First Agent
Let's build a simple counter agent from scratch. Replace src/server.ts:
import { Agent, routeAgentRequest, callable } from "agents";
// Define the state shape
type CounterState = {
count: number;
};
// Create the agent
export class Counter extends Agent<Env, CounterState> {
// Initial state for new instances
initialState: CounterState = { count: 0 };
// Methods marked with @callable can be called from the client
@callable()
increment() {
this.setState({ count: this.state.count + 1 });
return this.state.count;
}
@callable()
decrement() {
this.setState({ count: this.state.count - 1 });
return this.state.count;
}
@callable()
reset() {
this.setState({ count: 0 });
}
}
// Route requests to agents
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
return (
(await routeAgentRequest(request, env)) ??
new Response("Not found", { status: 404 })
);
}
};
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 306 lines · 0 tokens per session scan A 57d33268d985
getting-started is an agent published in the GitHub repository cloudflare/agents (5,498 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,962 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
arxiv-2307-07191
Agent "arxiv-2307-07191" from SAIRAMANALADI/vybe-intelligence-vault, covering summary, why it matters, paper metadata and key topics & tags.
0x4m4-hexstrike-ai
Explain why this repository is useful for advanced web development, 3D frontend, animations, UI systems, or creative development.
0xsteph-pentest-ai-agents
Explain why this repository is useful for advanced web development, 3D frontend, animations, UI systems, or creative development.
15-updates-from-google-i-o-2026-powering-the-agent
General public resource representing technology updates, guides, or tutorials.
amap-ml-longhorizon-harness
Explain why this repository is useful for advanced web development, 3D frontend, animations, UI systems, or creative development.
24-i-cset-awesome
General public resource representing technology updates, guides, or tutorials.