Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

workers-profiling — Claude Code skill: profile Workers CPU and memory

Skill for analyzing CPU and memory usage in deployed Cloudflare Workers and Durable Objects. Finds expensive functions and proposes code optimizations.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add cloudflare/skills --skill workers-profiling -a claude-code
Open on GitHub

What workers-profiling does

The skill walks you through profiling: identify the symptom (high CPU, latency, memory pressure), capture a pprof profile using the cf CLI or API, analyze hotspots in functions and allocations. It maps findings back to source code, and if source maps are missing, suggests enabling them and re-profiling.

Once evidence is clear, the skill proposes the smallest actionable code change that resolves the issue and explains how to verify the fix. Works with Workers and Durable Objects; requires access to deployed code and Cloudflare account permissions to read profiles.

Report includes evidence for each finding—file, function, source location, and metrics—plus the minimal change and how to measure its effect.

What it helps with

  • find functions consuming CPU in production
  • detect memory leaks in Durable Objects
  • identify where code allocates the most memory
  • optimize code using real profiling data
  • trace latency in deployed Workers

Example prompts for the agent

  • Profile CPU for this Worker, find hotspots and suggest optimization
  • Capture a heap profile from the Durable Object and show where memory grows
  • Analyze the pprof file, identify the most expensive functions and rewrite them

How to install workers-profiling

1Skills CLI (Vercel)

npx skills add cloudflare/skills --skill workers-profiling -a claude-code

2Manually: put the files in place

~/.claude/skills/workers-profiling/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/workers-profiling/

From the same set18

The whole set →
cloudflare cloudflare Helps coding agents pick the right Cloudflare products for applications, storage, and AI, while routing between cf CLI and Wrangler. Claude Code CX Codex Cursor +1 136,500installs wrangler cloudflare Runs and troubleshoots Wrangler CLI commands for Cloudflare Workers projects that use wrangler configuration files. Claude Code CX Codex Cursor +1 128,500installs workers-best-practices cloudflare Guides coding agents on production Cloudflare Workers standards, Wrangler typing, observability setup, and runtime anti-pattern checks. Claude Code CX Codex Cursor +1 124,900installs durable-objects cloudflare This skill helps build, debug, and review Cloudflare Durable Objects for state, coordination, and persistent connections. Claude Code CX Codex Cursor +1 109,700installs web-perf cloudflare Audit Core Web Vitals, diagnose rendering bottlenecks, and inspect network dependencies directly through your agent. Claude Code CX Codex Cursor +1 109,300installs agents-sdk cloudflare Helps build, debug, and review Cloudflare Agents SDK applications using the agents package and official documentation. Claude Code CX Codex Cursor +1 105,700installs cloudflare-email-service cloudflare A skill for Cloudflare Email Sending and Email Routing: it walks the agent through sending and receiving mail in Workers. Claude Code CX Codex Cursor +1 101,400installs cloudflare-one cloudflare Walks your agent through designing, configuring and troubleshooting Cloudflare One Zero Trust and SASE deployments. Useful when you need Access, Gateway or tunnel work done without digging through docs yourself. Claude Code CX Codex Cursor +1 92,200installs

Similar

cli-setup cheaper-inference Helps the agent configure OmniRoute, manage autostart, apply CLI updates, and adjust session environment variables. Claude Code CX Codex Cursor +1 1,200installs bigquery-observability official google This skill helps retrieve BigQuery telemetry and choose the right data source. Use it to inspect jobs, slot contention, queues, reservations, and resource usage. Claude Code Gemini CLI CX Codex 1,800installs websocket-engineer https://github.com/Jeffallan This skill guides WebSocket and Socket.IO work with bidirectional messages, rooms, presence tracking, and Redis-based scaling. Claude Code CX Codex Cursor +1 6,800installs ov-experience-memory volcengine Retrieves OpenViking operational memories during coding, migrations, and deployment. It equips agents with past debugging steps to resolve recurring failures. Claude Code CX Codex Cursor +1 550installs gke-storage-troubleshooting official google Diagnoses persistent storage failures in GKE, such as attach errors and Cloud Storage FUSE OOM. Useful when Pods are stuck in ContainerCreating or nodes report storage pressure. Claude Code Gemini CLI CX Codex 1,700installs github-actions-efficiency official github This skill reviews GitHub Actions workflows, finds wasted CI minutes, and suggests cost-focused fixes. Use it when tuning workflow triggers, caching, or job layout. GitHub Copilot 2,000installs wizard Matt Pocock This skill creates an interactive bash wizard for manual setup steps, CI secrets, third-party dashboards, and one-off migrations. Claude Code 553,369installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. Claude Code CX Codex Cursor +1 1,200,000installs

Questions about workers-profiling

How do I install workers-profiling in Claude Code?

Run npx skills add cloudflare/skills --skill workers-profiling -a claude-code; the skill profile will appear at ~/.claude/skills/workers-profiling/SKILL.md.

What does workers-profiling do?

Analyzes CPU and memory in deployed Workers and Durable Objects: finds expensive functions, maps them to source code, and proposes concrete optimizations backed by pprof data.

What tools do I need to profile?

The primary method uses the cf CLI; if it's not installed, the skill will prompt you. Profiles are returned as pprof files, which you can analyze directly or with tools like Go's pprof utility.

Source text

SKILL.md · Apache-2.0
---
name: workers-profiling
description: Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code.
---

# Workers profiling

Find expensive functions or memory allocations in deployed code and come up with ways to fix them.

## Retrieve the docs

Start with the [production profiling guide](https://developers.cloudflare.com/workers/observability/profiling-in-production/index.md) to understand how
Workers and Durable Objects profiling works.

## Profiling steps

1. Identify the symptom and affected workload: CPU usage, latency, allocation pressure, or memory growth.
2. Confirm the account, Worker, environment, and deployed version with the user.
3. For a Durable Object, also confirm its owning Worker, namespace, and instance.
4. Choose CPU or heap profiling from the current guide's supported types and meanings.

Where possible, use the [`cf` CLI](https://developers.cloudflare.com/cf/index.md) to capture profiles. If the user requests `cf`, inspect the installed version's command help and schema where available.

If `cf` isn't available, consider prompting the user whether they would like to install it.


The profiling API will return a pprof file which you can analyze directly, or using appropriate tools like Go's `pprof` utility.

## Inspect the evidence

- Read the pprof file and analyse it for hotspots
- Map hotspots to functions and source locations when evidence supports it; report missing symbols or source mappings.
- If filenames and function names are pointing at the generated JavaScript, consider suggesting to the user to enable source maps and re-do the profiling.

## Optimise

Propose the smallest code change supported by the capture which resolves the issues identified.

## Report findings

Return a concise report with:

- Evidence for each finding: file, function, source location, and metric with units, where available.
- The smallest actionable change and how to check its effect.

© cloudflare · Apache-2.0 · cloudflare/skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor