Remix.run Logo
ljm a day ago

I never knew that running an interactive program in my terminal would absolutely rinse my CPU and battery but that's what Claude, OpenCode and Ghostty have colluded to achieve. Even when the laptop is asleep overnight it's practically melting.

I'm sure there was some logical reason for shoehorning web technology into this stack given that we have a good 40 years or so of experience with interactive terminal programs that use curses/ncurses, alongside emacs, vim, almost the entirety of MS-DOS, and so on.

vmg12 a day ago | parent | next [-]

The fundamental problem with all Js based apps is how they are very single threaded.

With js you get 1 thread at 100% utilization. Power usage and heat scale non-linearly with cpu utilization and 100% utilization on a single threaded js app means you will have ui lag. Other languages like golang would split work across 8 threads and have 8 threads at 20% utilization and this would result in less power usage. Claude Code would have been better off performance wise being an electron app because it would be offloading rendering to the browser and gpu.

Also, the architecture of Open Code is actually a lot better here than Claude Code. ClaudeCode does everything, including rendering in a single thread and it's all in js. OpenCode has a zig based tui renderer it offloads that work onto.

But I will also say these coding agent tuis do get unfairly maligned because they launch subprocesses and those subprocesses tend to be expensive. If you are using Rust analyzer with claude code, it's rust analyzer that's causing the majority of your problems.

wild_egg a day ago | parent | next [-]

No, the fundamental problem of these apps is that they are, for no reason, pretending they need a high powered game engine rendering loop. They don't. It's a text printout of history with some hotkeys for mode switches and such. "rendering in a single thread" should never be an issue because it should never be "rendering". It needs to stream text to stdout. That's been a solved problem for 50 years and now it takes 2GB of memory to be done poorly with broken scrollback.

vmg12 a day ago | parent [-]

Drawing to the terminal / rendering / whatever, this is all arguing semantics and very uninteresting and not insightful.

> they need a high powered game engine rendering loop

Don't believe the bs on twitter. Claude code source was leaked, there is no high powered game engine rendering loop.

> It needs to stream text to stdout

These apps are doing real work taking text that is streaming in and doing syntax highlighting, calculating diffs, and rendering markdown. If the work was split across threads they would not use anywhere close to as much power and there would not be a slow ui.

If you think this is actually nothing, prove it. Put the code up on github that shows taking a constant random stream of markdown, code, and diffs and displays it in the terminal can be done cheaply on a single thread.

The reason the computer gets hot and uses more power is because the cpu is getting close to 100% utilization.

wild_egg 21 hours ago | parent | next [-]

There are two different arguments here.

> These apps are doing real work taking text that is streaming in and doing syntax highlighting, calculating diffs, and rendering markdown.

The first argument is that these are expensive operations. They are not. And the second argument is the assumption that these are desirable things for an agent system to be doing. That's a personal preference but, personally, I don't want them and would appreciate a way to disable all of that to reduce CPU use.

vmg12 20 hours ago | parent [-]

The argument is that doing it all on a single thread will result in high cpu utilization and that is what makes the power usage spike and the pc feel hot. Thats it.

A lot of people go “js is bad” reflexively and they are right for the wrong reasons. Its not because js (specifically v8) is slow. I have many websites and web based apps open and none fuck up my laptop as hard as claude code.

hahahaa 18 hours ago | parent [-]

Yeah I don't get it we had terminals on single core machines. In early 2000s I am sure they could handle the UI of Claude (probably IO too).

wild_egg 18 hours ago | parent [-]

Early 2000s tech could absolutely handle LLM agents as a client. They output like 1-2kbps and even dial up modems would have plenty of capacity for other traffic.

The UI itself requires laughably simple tech. The idea that a markdown renderer that can produce HTML at 50MB/s would use much CPU to process incoming hundreds of bytes per second is insane. CPU should be idle even if doing that constantly. Nevermind that between turns it has nothing to do whatsoever and should use zero CPU at all.

mixmastamyk 20 hours ago | parent | prev | next [-]

Stuff doable on a pentium 90, and before that, just slowly.

hahahaa 18 hours ago | parent [-]

I wonder if those were fast enough nostalgia says yes but I bet it was dog slow if we tried today with 2026 lens.

mixmastamyk 17 hours ago | parent [-]

My Turbo Pascal programs could calculate and print to the screen faster than could be read, on a 486. With DOS however.

I picked the P90 because I remember running Linux ~1.0 and/or NT on it, with real multitasking and services etc. Those soaked up many of the cycles.

Another story, around Y2k/Win2k was asked to write a C program to record all the files/sizes on the C: in to file. Then something would be installed, my program run again, and the results diffed. Despite thousands of files the program was done before the enter key came back up. Boss told me that he thought the program was cheating.

That’s just how fast modern computers are these days, I said. When running C code anyway. That perf is still available today, compare astral’s uv to slow competitors. Just takes some investment, though probably less when boosted by VC bionics.

wild_egg 16 hours ago | parent [-]

"The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry."

— Henry Petroski

mixmastamyk 12 minutes ago | parent [-]

Yup, Andy giveth what Bill taketh away.

nnmg 21 hours ago | parent | prev | next [-]

I don't think any of that seriously counts as real work.

Casey Muratori addressed this years ago with the windows terminal drama, https://github.com/cmuratori/refterm

cdelsolar 17 hours ago | parent | prev | next [-]

The heck? It does all that rendering for a tiny fraction of the total amount of time that the TUI is running. The streaming is IO bound, there’s no way that it’s outputting nearly enough text to tax the CPU that much.

anthk a day ago | parent | prev | next [-]

Sorry, but nope; Golang there would be there a beast doing that in a much, much faster way. Not to mention C/C++ with NCurses.

vmg12 21 hours ago | parent [-]

> If you think this is actually nothing, prove it. Put the code up on github that shows taking a constant random stream of markdown, code, and diffs and displays it in the terminal can be done cheaply on a single thread.

Put up the code and prove it. We already know exactly how fast golang is in comparison to nodejs on basic numeric computations, it's roughly 40 to 50% faster.

wild_egg 20 hours ago | parent [-]

https://pierre.computer/writing/on-rendering-diffs

redsocksfan45 21 hours ago | parent | prev [-]

[dead]

zahlman 11 hours ago | parent | prev | next [-]

> Power usage and heat scale non-linearly with cpu utilization

I don't doubt this, but I would love details and citations here.

cozzyd a day ago | parent | prev | next [-]

I'm not concerned with CPU use/wakeups while actively using it, but with it sitting idle doing nothing.

skydhash a day ago | parent | prev [-]

That’s not really a big issue. In major OS like the BSD, SMP implementation are not that old. If we can have a full OS running in single core mode, we can have an application being performant too. I’m currently running OpenBSD on 4 cores and it’s basically 99% idle.

Bad coding is just bad coding.

vmg12 a day ago | parent [-]

It's basically idle because it's not doing anything. If you are streaming in markdown and code and then doing syntax highlighting on this code in real time, then rendering it on the screen you are doing actual work.

It's also all cpu bound work. The majority of the stuff on your screen is being rendered by the gpu.

wild_egg 17 hours ago | parent [-]

> If you are streaming in markdown and code and then doing syntax highlighting on this code in real time, then rendering it on the screen you are doing actual work.

You are really, really not. Not at LLM inference speeds at least. Frontier models output maybe 200 bytes per second on the fast end. I guarantee you that idle BSD box is still processing more than 200 bytes of whatever at any point in time. Streaming 200 bytes of LLM output through syntax highlighting, markdown rendering, and diff formatting, will still leave the box basically idle if done correctly. Claude Code has not done it correctly.

skydhash 16 hours ago | parent [-]

Processors today are very fast. If you are spiking it on rendering diffs, you’re doing it wrong. I can’t even stress it building openbsd’s kernel.

senderista a day ago | parent | prev | next [-]

Why are you implicating ghostty? Have you compared its CPU usage to any other terminal?

ljm a day ago | parent | next [-]

Of course I have. If I see ghostty constantly consuming the most energy and helping reduce my battery life to barely 2 or 3 hours, the first thing I'm going to do is switch terminal to see if I can improve that situation. The built in terminal and WezTerm have been fine and I've had much more reasonable battery life since.

This does not even speak to it pegging my CPU and keeping the fans running on full blast even when the laptop is supposed to be idle overnight.

andruby a day ago | parent | next [-]

This seems a suspicious. How do you measure the CPU load of Ghostty? Is the measure/reporting method just attributing the cpu load of the commands/programs you're running in Ghostty to Ghostty?

You could test this by running "yes > /dev/null" in Ghostty. In Activity Monitor on my Macbook it shows `yes` using 100% and Ghostty using 0.5% of cpu.

benrutter 21 hours ago | parent | prev | next [-]

If you're looking for a non-ghostty recommendation (not that I have anything against ghostty) I use alacritty + zellij and it works fantastic. It doesn't seem to impact battery, I certainly get good battery usage on both my work and home laptops.

mtlmtlmtlmtl 18 hours ago | parent [-]

I've messed around with pretty much all the fancy new terms to varying extents. Ghostty, wezterm, alacritty, etc. And I'm all in favour of people innovating in this space again. But at the end of the day, I always end up back with xterm. It's reasonably lightweight, runs and is packaged absolutely everywhere, I never have to muck about with termcap files and/or $TERM on remote hosts, and I've never had it break, crash, or exhibit any kind of bug or strange behaviour in over a decade of using it. The only TUI that has some quirks in xterm is Emacs, but Emacs has weird quirks in every term I've tried to run it in, and different quirks in every case somehow, so I just chalk that up to Emacs being weird. I'm sure xterm has some bugs buried in it still, but I bet all of them are in codepaths that are almost never reached nowadays, or at least are extremely niche. It does lack some features like ligature fonts(I just decided not to care), sixels and similar graphics things(again, don't really care) and panes/tabs/yadda yadda(tmux or screen or whatever you like can do all of that anyway).

Never had to dig through the xterm bug tracker to figure something out. I don't even know what version I'm running, or even what the versioning scheme looks like. I haven't changed the configuration since the first time I set it up. It just works.

st3fan a day ago | parent | prev [-]

Same. I really want to file a proper bug report for this but I haven't been able to really dig into the details and the last thing I want is a "ghostty is a cpu hog" kind of report without useful info on how to debug that.

agrippanux a day ago | parent | prev | next [-]

I don't know if its still the case anymore since 1.3 but Ghostty did have a documented issue with Claude causing resource issues.

tdhz77 a day ago | parent | prev [-]

I think the author is saying everything that touches llm.

LtWorf 5 hours ago | parent | prev | next [-]

> Even when the laptop is asleep overnight it's practically melting.

Then something is waking it up and it's not asleep at all. Asleep the CPU shouldn't be running.

a day ago | parent | prev | next [-]
[deleted]
blt 13 hours ago | parent | prev | next [-]

yep, developers from 10 or even 5 years ago would have considered it a hilarious joke

myaccountonhn a day ago | parent | prev [-]

Its so wasteful, but that tracks with the modus operandi of AI companies.