logoalt Hacker News

gjsman-1000yesterday at 5:53 PM9 repliesview on HN

Also explains why Claude Code is a React app outputting to a Terminal. (Seriously.)


Replies

krystofbeyesterday at 8:31 PM

I did some debugging on this today. The results are... sobering.

Memory comparison of AI coding CLIs (single session, idle):

  | Tool        | Footprint | Peak   | Language      |
  |-------------|-----------|--------|---------------|
  | Codex       | 15 MB     | 15 MB  | Rust          |
  | OpenCode    | 130 MB    | 130 MB | Go            |
  | Claude Code | 360 MB    | 746 MB | Node.js/React |
That's a 24x to 50x difference for tools that do the same thing: send text to an API.

vmmap shows Claude Code reserves 32.8 GB virtual memory just for the V8 heap, has 45% malloc fragmentation, and a peak footprint of 746 MB that never gets released, classic leak pattern.

On my 16 GB Mac, a "normal" workload (2 Claude sessions + browser + terminal) pushes me into 9.5 GB swap within hours. My laptop genuinely runs slower with Claude Code than when I'm running local LLMs.

I get that shipping fast matters, but building a CLI with React and a full Node.js runtime is an architectural choice with consequences. Codex proves this can be done in 15 MB. Every Claude Code session costs me 360+ MB, and with MCP servers spawning per session, it multiplies fast.

show 4 replies
jama211yesterday at 6:04 PM

There’s nothing wrong with that, except it lets ai skeptics feel superior

show 5 replies
kronayesterday at 6:17 PM

Sounds like a web developer defined the solution a year before they knew what the problem was.

thehamkercatyesterday at 5:59 PM

Same with opencode and gemini, it's disgusting

Codex (by openai ironically) seems to be the fastest/most-responsive, opens instantly and is written in rust but doesn't contain that many features

Claude opens in around 3-4 seconds

Opencode opens in 2 seconds

Gemini-cli is an abomination which opens in around 16 second for me right now, and in 8 seconds on a fresh install

Codex takes 50ms for reference...

--

If their models are so good, why are they not rewriting their own react in cli bs to c++ or rust for 100x performance improvement (not kidding, it really is that much)

show 5 replies
sweetheartyesterday at 6:15 PM

React's core is agnostic when it comes to the actual rendering interface. It's just all the fancy algos for diffing and updating the underlying tree. Using it for rendering a TUI is a very reasonable application of the technology.

show 1 reply
tayo42yesterday at 6:02 PM

Is this a react feature or did they build something to translate react to text for display in the terminal?

show 4 replies
CooCooCaChayesterday at 6:02 PM

It’s really not that crazy.

React itself is a frontend-agnostic library. People primarily use it for writing websites but web support is actually a layer on top of base react and can be swapped out for whatever.

So they’re really just using react as a way to organize their terminal UI into components. For the same reason it’s handy to organize web ui into components.

show 1 reply
CamperBob2yesterday at 6:53 PM

Also explains why Claude Code is a React app outputting to a Terminal. (Seriously.)

Who cares, and why?

All of the major providers' CLI harnesses use Ink: https://github.com/vadimdemedes/ink