[BUG] As context grows, claude code becomes unusable
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 11 comments · opened Nov 24, 2025 · closed Feb 28, 2026
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?
Claude code has been working fine up until two days ago. Now as context gets larger, the terminal becomes unresponsive and claude response time slows down massively. At about 1k context, typing commands into terminal becomes delayed significantly. At about 15k context, I can't type anything at all and claude becomes almost unresponsive (it updates every 10 minutes or so).
What Should Happen?
Claude should be usable. This isn't usable. I have to restart Claude every time the context reaches 1k in order to get work done.
Error Messages/Logs
Steps to Reproduce
Do tasks. Let context grow.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
I'm not sure. Didn't have this problem at all a few days ago.
Claude Code Version
2.0.50 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
11 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The only one of these issues that my issue shares attributes with is #2 in that performance degrades, but in my case, it degrades specifically with context growth and not "as it approaches context limit" which is listed in #1. This is happening to a degree even when context is at 500, by 1000 it is very noticeable, by 15k it is unusable. I should be able to use 200k context, correct?
Same for me! And few days ago was working much better. Windows, same version.
Yeah the terminal glitches out, it just like try's to display the entire context after compaction or the refresh rate tries to display literally everything instead of what Claude's actually doing causing the worst visual glitch that prevents you from even using it.
This is a easily replicable issue.
This is the most annoy thing thing ever.
I've found it's actually easier to use Claude code via not using it lmao, just using screen and trailing output/sending input commands XD -- but that's still a cooked choice too because screen just well another screen, so even that still fails.
I've noticed how quickly this occurs, literally is dependent upon how big you irl screen size is, smaller screen? More unusable faster.
It's so broken it's not even funny.
What's ironic is Claude itself could probably fix this issue 💀
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
claudescreenfix-hardwicksoftware | justcalljon.pro
yo this fixes the scroll glitch that's been cooking everyone using claude code. you know the one - after like 30 minutes your terminal starts lagging, scrolling takes forever, and eventually the whole thing just dies.
shoutout to the big dogs who should probably just fix this themselves
hey @anthropics yall made a sick product but this scrollback thing been cooking people for months lol. maybe steal this fix idc
real talk tho @anthropics just add
\x1b[3Jto your clear command and debounce SIGWINCH. thats literally it. im not even asking for credit just fix it for everyone 💀what's the problem
so here's the deal. claude code uses ink (it's like react but for terminals). every time something updates, ink re-renders everything. that's fine normally.
but here's where it gets ugly - it doesn't clear the scrollback buffer. ever. not once.
so after a while you've got thousands of lines sitting in your terminal's memory. every single re-render has to process all of em. resize your window? that triggers a re-render too. tmux users get hit especially hard cuz resize events fire like crazy with no chill.
the result: your terminal slows to a crawl. scrolling back takes 30+ seconds. your fans spin up. it's bad. real talk it's been annoying everyone.
what this does
hooks into node's stdout at startup and does three things:
no patches to claude code itself. works with any version. just loads before claude starts and you're good.
install
that's it. you don't need anything else.
usage
option 1: use the wrapper (easiest)
instead of running
claude, runclaude-fixed. it finds your claude install and runs it with the fix loaded. couldn't be simpler.option 2: alias it
throw this in your
.bashrcor.zshrc:now
claudeautomatically uses the fix. you won't even notice it's there.option 3: manual loading
if you're the type who wants full control:
or set NODE_OPTIONS if that's more your style:
config
here's what you can tweak via env vars:
| var | what it does | default |
|-----|--------------|---------|
|
CLAUDE_TERMINAL_FIX_DEBUG| set to1for debug logs | off ||
CLAUDE_TERMINAL_FIX_DISABLED| set to1to disable entirely | off |api
if you wanna use it programmatically here's how:
how it works
the fix hooks
process.stdout.writebefore claude loads. when ink writes to the terminal, we check if it's doing a screen clear (which happens on every re-render). after enough renders, we inject the ANSI escape sequence\x1b[3Jwhich tells the terminal to dump its scrollback buffer.for resize events, we intercept
process.on('SIGWINCH', ...)and debounce the handlers. instead of firing immediately, we wait 150ms. if more resize events come in during that window, we reset the timer. only fires once things settle down.bottom line: smooth terminal, no lag, no memory bloat. it just works.
changelog
v1.0.1 (2025-01-08)
setImmediateto not block the event looptypingCooldownMs(default 500ms) - how long to wait after typing before allowing clearsv1.0.0 (2025-01-08)
known issues
\x1b[3Jbut that's pretty rare nowadayswhat this fixes
people have been complaining about:
you shouldn't have to restart claude every 30 minutes anymore.
license
MIT - do whatever you want with it
Confirming this issue - detailed diagnostics from our setup
We're experiencing the same problem on our Hetzner CX32 server (4 vCPU, 8GB RAM, Ubuntu 24.04). Here are our findings after ~2 hours of systematic testing:
Environment
--dangerously-skip-permissions)Key Finding: Memory Growth Rate Comparison
We ran two identical Claude Code sessions and measured memory growth:
| Session | Runtime | RAM Usage | Growth Rate |
|---------|---------|-----------|-------------|
| claude-user | 23 min | 669 MB | ~29 MB/min |
| root | 91 min | 350 MB | ~3.8 MB/min |
The claude-user session had 7.6x faster memory growth!
Timeline of claude-user session:
Factors that seem to accelerate the issue:
claude-powerline, lag persistedObservations:
--continueflag loads previous context, so it's NOT a clean restart (starts with ~500MB immediately)Workaround we're using:
--continue) when RAM exceeds ~500MBps aux | grep claudeNote on claudescreenfix-hardwicksoftware:
We reviewed the code posted above - it looks legitimate (clean JS, MIT license, hooks stdout.write to inject
\x1b[3Jfor scrollback clearing). However, since it's only 1 day old with 0 stars, we're waiting for community validation before installing.Would be great to see an official fix from Anthropic. The scrollback buffer issue with Ink seems to be the root cause.
---
Diagnostics performed by Claude Code Opus 4.5 (claude-opus-4-5-20251101) under claude-user@91.10....
Community review is going to take a hot minute cuz I'm not a big developer lol...
But since you're running Claude on a VPs like I am..
I have a very interesting MCP tool in the works that will greatly benefit the community
It's called specmem!
Research available at https://justcalljon.pro/research-blog#specmem
You can rest assured my code for the Claude terminal fix is safe, you can go through it yourself, I've been making multiple updates/upgrades and switched to a PTY approach :)
Claude code uses nodejs
So just plant yourself between Claude and the node js lmao.
I myself don't know WHY Claude devs haven't implemented a fix, and why context from previous compactions even shows the fuck up in the first place!
They really need to work on that
@aranej would love to work with you guys!
this is unacceptable. Please fix this, it's critical not a small issue.
I CANT USE IT CURRENTLY
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.