cloudflare / cloudflare/sandbox-sdk
Claude Code has high CPU usage spikes
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 114
- Avg merge
- 22h 42m
- Merged PRs (30d)
- 14
Description
I've been trying to run Claude Code in the sandboxes, but there appear to be long-standing issues with Claude Code, where it would suddenly spike in CPU usage and eat up an entire core. The session becomes completely unusable, and you have to kill -9 it from a different process.
I've had it happen more often than not when using standard-4 & opus, and it's better when using models like sonnet or haiku.
I know that this isn't a Cloudflare Sandboxes issue per se, but it could be nice to have some sort of built-in way to recover when that happens, especially since we're charged by compute. Otherwise, it becomes untenable to run the containers 24/7 if processes can go haywire. Not sure if you have run into this, but it appears to be a known issue for CC.
https://github.com/anthropics/claude-code/issues/19393
Contributor guide
Assessment
This issue has not been assessed yet.