[BUG] High memory usage during claude install.sh
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
This issue is a summary of the recent improvements to the memory usage during a fresh Claude Code installation using the install.sh script.
As of today, with Claude Code version 2.1.215, the memory resident set size (RSS) during the Claude Code fresh installation appears reduced, to about 200MB (from 11GB), and the virtual memory size to about 500MB (from 70GB) on a particular Linux VM used for tests.
The high memory usage (measured by RSS) during installation was reported in December 2025.
Around the same time high memory usage during claude update was reported, but it's not the subject of this summary. RSS growth during regular Claude Code usage is not the subject of this summary either.
This was reported as early as in May 2025 and the issue appears still ongoing with Claude Code 2.1.201.
Here are the recent improvements of the memory usage by the (native) installer:
2.1.179 - last version with high memory usage during installation.
The memory usage was erratic - running the install.sh on a fresh VM with 12GB or RAM could reach the RSS values from the lowest 1GB to highest 11GB.
<img width="1152" height="378" alt="Image" src="https://github.com/user-attachments/assets/80ec37a1-c3a0-4327-bec5-c2a3ceead375" />
<img width="1152" height="378" alt="Image" src="https://github.com/user-attachments/assets/babf9f5e-45d5-4d5f-97f8-593bbd35ab4a" />
2.1.181 - first version with slightly smaller memory usage, and not that erratic.
The maximum RSS seen is about 600MB.
This is the first Claude Code version that uses Bun rewrite in Rust.
There are no public releases between 2.1.179 and 2.1.181 and the latter does not include any changelog entry that could suggest memory usage improvements.
<img width="1152" height="378" alt="Image" src="https://github.com/user-attachments/assets/c6e7975e-0020-4a3c-babb-368ca6db2d9d" />
2.1.205 - this release contains the changelong entry claiming installer's memory usage reduction.
The changelog contains Auto-update binary downloads now stream to disk instead of buffering in memory, cutting the updater's peak memory usage by roughly 400 MB, and indeed seems to reduce the RSS by about that amount.
<img width="1152" height="378" alt="Image" src="https://github.com/user-attachments/assets/c80170f7-95f7-4de7-b4ed-5d079dd6236d" />
<img width="1152" height="378" alt="Image" src="https://github.com/user-attachments/assets/93a46f5b-6a08-439e-af4c-cb81e4321123" />
2.1.214 - first version with slightly smaller virtual memory size.
There is no public version between 2.1.212 and 2.1.212. There is no changelog entry that suggests the virtual memory size was reduced.
<img width="1152" height="378" alt="Image" src="https://github.com/user-attachments/assets/5b541e71-51e4-48c4-8af8-da52a4cbfed4" />
<img width="1152" height="378" alt="Image" src="https://github.com/user-attachments/assets/ff99e28c-b941-465e-a45b-99274d830dec" />
What Should Happen?
Claude Code install.sh script should not use Gigabytes of RSS.
Error Messages/Logs
Steps to Reproduce
Install the desired claude code using docker build, for example:
docker run --rm -it --name cc --memory=12g debian:trixie bash -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl && curl -sL https://claude.ai/install.sh | sed 's/ install / install --force /' | sed 's|version=.*|version=\${TARGET}|' | bash -x -s 2.1.181"
Use the bisection method to identify memory usage changes across claude code versions.
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.179 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Non-interactive/CI environment
Additional Information
Tagging a few people who showed concern about the installer high memory usage @Hyohko @AlexanderVott @georges-titanx @timdev.