[BUG] Long running session crashes on /compact

Resolved 💬 6 comments Opened May 28, 2025 by ChristopherA Closed Dec 7, 2025

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [x] Other: <!-- specify -->
  • Claude CLI version: <!-- output of claude --version --> 1.0.3 (Claude Code
  • Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 --> macOS 15.5
  • Terminal: <!-- e.g. iTerm2, Terminal App --> (macOS Terminal.app)

Bug Description

<!-- A clear and concise description of the bug -->

Crash on /compact (log below).

I believe I had over 10% remaining, but I've probably done 15+ /compacts since the last time I fully exited to shell. The was no report of an upgrade available.

Steps to Reproduce

  1. <!-- First step -->
  2. <!-- Second step -->
  3. <!-- And so on... -->

Unknown

Expected Behavior

<!-- What you expected to happen -->

Normal /compact result

Actual Behavior

<!-- What actually happened -->

Crash, exit to shell.

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->

Errors to console on crash:

<--- Last few GCs --->

[55646:0x128008000] 326897527 ms: Scavenge (interleaved) 4080.9 (4099.4) -> 4079.0 (4099.4) MB, pooled: 0 MB, 3.12 / 0.00 ms  (average mu = 0.177, current mu = 0.201) allocation failure; 
[55646:0x128008000] 326898820 ms: Mark-Compact 4081.1 (4099.7) -> 4079.1 (4099.2) MB, pooled: 1 MB, 1291.46 / 0.00 ms  (average mu = 0.152, current mu = 0.127) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0x10449df0c node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
 2: 0x104649ca4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
 3: 0x104806ce8 v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
 4: 0x10480c780 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1::operator()() const [/opt/homebrew/Cellar/node/23.11.0/bin/node]
 5: 0x10480702c void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1>(heap::base::Stack*, void*, void const*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
 6: 0x1043b0028 PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/23.11.0/bin/node]
 7: 0x104803f14 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
 8: 0x1047fd968 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
 9: 0x1047fe330 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
10: 0x1047ef3dc v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
11: 0x104ab2218 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
12: 0x10428f9f4 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/23.11.0/bin/node]
13: 0x130763ef8 
14: 0x130b3df18 
15: 0x1042be61c Builtins_ArrayMap [/opt/homebrew/Cellar/node/23.11.0/bin/node]
16: 0x1041f96a0 Builtins_InterpreterEnterAtBytecode [/opt/homebrew/Cellar/node/23.11.0/bin/node]
17: 0x130bfb888 
18: 0x13048f4c4 
19: 0x130ba2d50 
20: 0x130ba4590 
21: 0x130ba12f8 
22: 0x1308056c4 
23: 0x1041f8838 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/23.11.0/bin/node]
24: 0x1307cf47c 
25: 0x104235e20 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/23.11.0/bin/node]
26: 0x104303298 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/23.11.0/bin/node]
27: 0x104225214 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/23.11.0/bin/node]
28: 0x1041f63f0 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/23.11.0/bin/node]
29: 0x10477bbe0 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
30: 0x10477c34c v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
31: 0x1047a6900 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
32: 0x1041faaac Builtins_CallApiCallbackOptimizedNoProfiling [/opt/homebrew/Cellar/node/23.11.0/bin/node]
33: 0x130bee3fc 
34: 0x1041f650c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/23.11.0/bin/node]
35: 0x1041f61b0 Builtins_JSEntry [/opt/homebrew/Cellar/node/23.11.0/bin/node]
36: 0x10477bc08 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
37: 0x10477b570 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
38: 0x1046607e4 v8::Function::Call(v8::Isolate*, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
39: 0x1043b16d4 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/23.11.0/bin/node]
40: 0x1043b1b94 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
41: 0x1043c9e08 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
42: 0x1045b7cd8 node::StreamBase::CallJSOnreadMethod(long, v8::Local<v8::ArrayBuffer>, unsigned long, node::StreamBase::StreamBaseJSChecks) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
43: 0x1045b7f5c node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
44: 0x10462f4e4 node::crypto::TLSWrap::ClearOut() [/opt/homebrew/Cellar/node/23.11.0/bin/node]
45: 0x10462f990 node::crypto::TLSWrap::Cycle() [/opt/homebrew/Cellar/node/23.11.0/bin/node]
46: 0x10462dfc0 node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
47: 0x1045be344 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
48: 0x1045be04c node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s*, long, uv_buf_t const*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
49: 0x107d4faf0 uv__stream_io [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
50: 0x107d56ca8 uv__io_poll [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
51: 0x107d46b58 uv_run [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
52: 0x1043b2488 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
53: 0x1044e543c node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
54: 0x1044e5190 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/23.11.0/bin/node]
55: 0x10445ca58 node::Start(int, char**) [/opt/homebrew/Cellar/node/23.11.0/bin/node]
56: 0x199f92b98 start [/usr/lib/dyld]
zsh: abort      claude . "Load CLAUDE.md"

View original on GitHub ↗

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