Cloudflare agent stack for hackathon teams
Start with Flue. Reach for the SDK when you need the runtime.
Choose the right harness before you compose products. This kit connects each decision to a current starter that can run locally and deploy on Cloudflare.
Choose the harness
Flue first. Branch when the requirement tells you to.
The choice is about harness and runtime control, not which logo a team prefers. Start with the highest-level path that still exposes the capability you need.
01 / Default
Flue 2.1Autonomous agent with Pi
Choose Flue for hooks, skills, subagents, tools, channels, durable conversations, and optional local or remote sandboxes.
- Best default for new agent projects.
- Deploys to Workers and Durable Objects.
- Uses Pi for model providers and harness behavior.
02 / Runtime control
Agents SDKNo Pi or SDK-specific primitives
Choose Agents SDK for direct state and RPC APIs, AI SDK integration, custom lifecycle behavior, Workflows, Browser Run, Voice, MCP, and WebSocket control.
- Lower-level and more composable.
- Strong fit for real-time product experiences.
- Includes experimental non-Pi harness work.
03 / Existing harness
SandboxRun Codex, Claude Code, or OpenCode
Choose Sandbox when the agent is an existing CLI or server harness that needs a full Linux environment, isolated credentials, files, previews, and policy-controlled egress.
- Workers Paid plan required.
- Docker-backed local development.
- Examples exist for Codex, Claude Code, and OpenCode.
Fast starts
Six paths that can carry a complete demo.
These cover the default framework, the Cloudflare SDK, an isolated coding harness, durable work, multi-agent delegation, and browser automation.
Recommended default
Start hereFlue 2.1 on Cloudflare
Build an autonomous TypeScript agent with a programmable hooks-based harness, Pi model providers, durable conversations, tools, skills, subagents, channels, and optional sandboxes.
npx @flue/cli@2.1.0 init my-agent --target cloudflare
cd my-agent
npm install
npm run check:types
npm run dev
npm run deploy- Use Flue first for a new autonomous agent. Move to Agents SDK when you need non-Pi harnesses or SDK-specific lifecycle and communication primitives.
- The Cloudflare target composes Flue's generated agent classes with the Cloudflare Agents SDK runtime.
Cloudflare Agents SDK
SDK pathAgents Starter
Start a real-time React chat agent with AI SDK models, Workers AI, state sync, tool calls, durable approvals, scheduling, vision, and WebSockets.
npm create cloudflare@latest -- --template cloudflare/agents-starter
cd agents-starter
npm install
npm run dev
npm run deploy- Choose this when you do not want the Pi harness or need direct Agents SDK APIs and lifecycle control.
Non-Pi coding harness
AdvancedCodex App Server
Run Codex in a Cloudflare Sandbox behind a WebSocket middleman, with a streaming UI, composable policy handlers, restricted egress, and secret injection outside the container.
git clone --depth 1 https://github.com/cloudflare/sandbox-sdk
cd sandbox-sdk/examples/codex-app-server
cp .dev.vars.example .dev.vars
npm install
npm run dev
npm run deploy- Requires a Workers Paid plan, Docker, and an OpenAI credential.
Agents plus Workflows
Runnable exampleConcurrent workflows with approval
Launch durable concurrent jobs from an Agent, stream progress into synchronized state, and pause for human approval without losing execution history.
git clone --depth 1 https://github.com/cloudflare/agents
cd agents/examples/workflows
npm install
npm run types
npm run startMulti-agent systems
Advanced showcaseAgents as Tools
Delegate to subagents, fan out work in parallel, detach long-running tasks, stream progress, cancel runs, and inspect durable milestones.
git clone --depth 1 https://github.com/cloudflare/agents
cd agents/examples/agents-as-tools
npm install
npm start- The example's search and file-inspection tools are simulated; replace them with real tools for a project.
Browser Run
BetaBrowser Live View
Automate a persistent browser session, expose its live view, hand control to a human for blocked steps, and resume the agent after intervention.
git clone --depth 1 https://github.com/cloudflare/agents
cd agents
pnpm install
cd examples/browser-live-view
pnpm startExtensions and labs
Add a capability, not another architecture.
Use these when voice, retrieval, MCP, on-demand skills, code execution, or full app generation is central to the judging story.
Real-time voice
BetaVoice Agent
Add speech-to-text, model turns, tool calls, and text-to-speech over a real-time WebSocket connection.
npm create cloudflare@latest voice-agent -- --template cloudflare/agents-starter
cd voice-agent
npm install @cloudflare/voice
npm run devStateful retrieval
Guided buildAgent with AI Search
Provision an AI Search instance, index content, and expose retrieval as a model tool from a stateful chat agent.
npm create cloudflare@latest -- ai-search-agent
cd ai-search-agent
npm i agents @cloudflare/ai-chat ai workers-ai-provider zod
npx wrangler types
npm run devModel Context Protocol
Recommended MCP pathStateless MCP Worker
Publish tools through the current stateless MCP handler path on Workers, with Streamable HTTP and no protocol session Durable Object.
git clone --depth 1 https://github.com/cloudflare/agents
cd agents/examples/mcp-worker
pnpm install
pnpm startOn-demand expertise
ExperimentalAgent Skills
Give an agent a catalog of instructions and resources that it activates only when a task matches, instead of putting every capability into every prompt.
git clone --depth 1 https://github.com/cloudflare/agents
cd agents/examples/agent-skills
npm install
npm startWorkers AI plus Sandbox
Runnable exampleCode Interpreter
Use Workers AI function calling to write and execute Python in an isolated Sandbox with file operations and structured results.
git clone --depth 1 https://github.com/cloudflare/sandbox-sdk
cd sandbox-sdk/examples/code-interpreter
npm install
npm run devComplete platform
Full stackVibeSDK
Use a production-grade text-to-app platform built with Think, project Durable Objects, Artifacts, Dynamic Workers, Facets, and AI Gateway.
Set up the agent building your agent
Install Cloudflare Skills before composing the stack.
Claude Code and Cursor have dedicated plugin paths. OpenCode, Codex, Pi, and other compatible environments can install the same portable skill bundle.
npx skills add https://github.com/cloudflare/skillsResource map
Keep the source and current docs beside the code.
The repositories move quickly. Prefer their current examples and live documentation over copied package versions or old workshop snippets.
Framework
Flue
Hooks-based agent harness, Pi providers, CLI, Vite target, Cloudflare runtime, sandboxes, channels, and observability.
Runtime SDK
Cloudflare Agents
State, RPC, scheduling, Workflows, subagents, chat, Browser Run, Voice, MCP, email, push, and durable execution.
Isolated execution
Sandbox SDK
Containers, commands, files, code interpreters, tunnels, previews, and integrations for Codex, Claude Code, OpenCode, and OpenAI Agents.