Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code.
Written by Cloudflare and published in cloudflare/skills under the Apache-2.0 license. Treq shows it unchanged except for heading levels and links to files on GitHub.
Find expensive functions or memory allocations in deployed code and come up with ways to fix them.
Start with the production profiling guide to understand how Workers and Durable Objects profiling works.
Where possible, use the cf CLI 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.
Propose the smallest code change supported by the capture which resolves the issues identified.
Return a concise report with:
If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.
Claude Code and Codex keep each installed skill's name and description in context. When a request matches the description, the agent loads the full SKILL.md. You can also run it yourself: type /workers-profiling in Claude Code or $workers-profiling in Codex.
Copy the workers-profiling folder into .claude/skills/ in your project. To use it in every project, copy it into ~/.claude/skills/ instead.
git clone --depth 1 https://github.com/cloudflare/skills.git /tmp/cloudflare-skills
mkdir -p .claude/skills
cp -r /tmp/cloudflare-skills/skills/workers-profiling .claude/skills/
Codex reads skills from .agents/skills/ in your repository, and from ~/.agents/skills/ for every repository. It detects new skills on its own. Restart Codex if workers-profiling does not appear.
git clone --depth 1 https://github.com/cloudflare/skills.git /tmp/cloudflare-skills
mkdir -p .agents/skills
cp -r /tmp/cloudflare-skills/skills/workers-profiling .agents/skills/
Open Settings and select the Skills tab. The tab appears when Skills installation is on under Settings → Feature Preview. Search for workers-profiling and choose Install….
Install for repository writes the skill under .treq/skills/ in the current repository. Install for application makes it available to every repository on this machine. Each new workspace gets a copy in .claude/skills/ and .agents/skills/, so Claude Code and Codex both find it. See Installing Skills from the Library.
workers-profiling ships 2 files, 4.9 KB in total. Select a file to load it from GitHub.