[BUG] UI Breaks and Crashes When Clearing Long Prompt History with Double Escape Key

Resolved 💬 4 comments Opened May 11, 2025 by tassa-yoniso-manasi-karoto Closed May 16, 2025

Environment

  • Platform (select one):
  • [ x] Anthropic API (MAX account)
  • Claude CLI version: 0.2.107 (Claude Code)
  • Operating System: Linux 6.12
  • Terminal: gnome-terminal

Bug Description

When going back into the history to a previous prompt, if that prompt happens to be very long and that you double press escape to clear it, the UI will go crazy: the content of the terminal will appear and disappear in flashes, and it alternates between sending you back to the beginning of the terminal at the initialization of Cloud Code and back to the end of the conversation. This happens in a loop and seems uncontrollable. Eventually, this caused apparently a memory-related crash:

<--- Last few GCs --->

[4401:0x3389c000] 128134557 ms: Mark-Compact (reduce) 2030.4 (2040.7) -> 2030.4 (2037.4) MB, pooled: 0 MB, 195.44 / 0.00 ms  (average mu = 0.836, current mu = 0.000) last resort; GC in old space requested
[4401:0x3389c000] 128134765 ms: Mark-Compact (reduce) 2030.4 (2037.4) -> 2030.4 (2037.4) MB, pooled: 0 MB, 208.30 / 0.00 ms  (average mu = 0.723, current mu = 0.000) last resort; GC in old space requested


<--- JS stacktrace --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0xe1eff7 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
 2: 0x121a420 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 3: 0x121a6f7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 4: 0x143928c v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 5: 0x141140e v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
 6: 0x1400524 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Tagged<v8::internal::Map>, v8::internal::AllocationAlignment) [node]
 7: 0x140242f v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [node]
 8: 0x1756b95 v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [node]
 9: 0x12323a3 v8::String::Utf8Length(v8::Isolate*) const [node]
10: 0x10b78cd node::StringBytes::Size(v8::Isolate*, v8::Local<v8::Value>, node::encoding) [node]
11: 0x10afd6b node::StreamBase::Writev(v8::FunctionCallbackInfo<v8::Value> const&) [node]
12: 0x10b342e void node::StreamBase::JSMethod<&node::StreamBase::Writev>(v8::FunctionCallbackInfo<v8::Value> const&) [node]
13: 0x7fbc83e0f6e2 
Aborted

Steps to Reproduce

see bug description

Expected Behavior

clear previous prompt and no crash

Actual Behavior

see bug description

Additional Context

IIRC it worked in the past, this seem like a recently introduced bug

Interestingly, after using claude --resume I was able to clear this very prompt without issues

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗