[BUG] Reliable OOM on vanilla install when sub-agent invokes non-existent Skill
Resolved 💬 3 comments Opened Jan 13, 2026 by hughescr Closed Feb 7, 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 is crashing with an OOM message when a sub-agent tries to invoke a skill that does not exist.
What Should Happen?
Claude should not crash, and should not allocate gigantic quantities of memory.
Error Messages/Logs
<--- Last few GCs --->
[56594:0x9ff40c000] 40283 ms: Mark-Compact 4062.1 (4119.4) -> 4052.9 (4126.4) MB, pooled: 0.0 MB, 803.08 / 0.00 ms (average mu = 0.092, current mu = 0.017) allocation failure; scavenge might not succeed
[56594:0x9ff40c000] 41020 ms: Mark-Compact (reduce) 4085.6 (4142.4) -> 4073.3 (4115.2) MB, pooled: 0.0 MB, 593.72 / 0.00 ms (+ 11.2 ms in 513 steps since start of marking, biggest step 3.1 ms, walltime since start of marking 654 ms) (average mu = 0.133
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x1006b58ac node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
2: 0x1007e436c v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
3: 0x1007e4324 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
4: 0x100991b68 v8::internal::Heap::ShouldOptimizeForLoadTime() const [/opt/homebrew/Cellar/node/25.2.1/bin/node]
5: 0x100994130 v8::internal::Heap::OldGenerationConsumedBytes() const [/opt/homebrew/Cellar/node/25.2.1/bin/node]
6: 0x100993fd8 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
7: 0x1009a1a24 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck)::$_1::operator()() const [/opt/homebrew/Cellar/node/25.2.1/bin/node]
8: 0x1009a16c8 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck)::$_1>(heap::base::Stack*, void*, void const*) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
9: 0x100fbe618 PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/25.2.1/bin/node]
10: 0x1009902e8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
11: 0x100988a3c std::__1::invoke_result<v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&>::type v8::internal::HeapAllocator::CollectGarbageAndRetryAllocation<v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&>(v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
12: 0x1009878ac v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
13: 0x10096fd68 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
14: 0x100c7fb54 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
15: 0x10107d474 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/25.2.1/bin/node]
16: 0x12cdafb58
17: 0x12cc5eb54
18: 0x12cd1ab70
19: 0x12cc42f08
20: 0x12cd11374
21: 0x12cd144bc
22: 0x12cc8ee98
23: 0x12ccb98d8
24: 0x100fda96c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/25.2.1/bin/node]
25: 0x100fda610 Builtins_JSEntry [/opt/homebrew/Cellar/node/25.2.1/bin/node]
26: 0x1008fc6d4 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
27: 0x1008fc0b8 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::base::Vector<v8::internal::DirectHandle<v8::internal::Object> const>) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
28: 0x10175b148 v8::Function::Call(v8::Isolate*, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
29: 0x100620edc 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/25.2.1/bin/node]
30: 0x1006211a8 node::InternalMakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
31: 0x1016ae32c node::Environment::CheckImmediate(uv_check_s*) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
32: 0x10472c214 uv__run_check [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
33: 0x104726b88 uv_run [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
34: 0x1006215c8 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
35: 0x1006e07e4 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
36: 0x1006e0518 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/25.2.1/bin/node]
37: 0x10068e754 node::Start(int, char**) [/opt/homebrew/Cellar/node/25.2.1/bin/node]
38: 0x19c749d54 start [/usr/lib/dyld]
Steps to Reproduce
The following prompt will reliably crash Claude Code every time (outside of plan mode) - the key is to have it start a sub-agent, and then for that sub-agent to generate a tool_call for a skill that does not exist:
I’m debugging a Claude Code crash that seems triggered when a sub-agent attempts to invoke a missing skill named "definitely-not-a-skill-123" and receives a tool_use_error ("Unknown skill: definitely-not-a-skill-123").
Please do the following, exactly and in this order:
1) Spawn a sub-agent whose ONLY job is to attempt to invoke the skill/tool named "definitely-not-a-skill-123" once.
- Do not do any other repo work first.
- Do not “think about alternatives” before attempting the invocation.
- The invocation should be explicit: attempt to call the Skill/tool/dispatcher named "definitely-not-a-skill-123" as if it exists.
2) After the invocation fails, the sub-agent must:
- Record/print the exact error it receives (verbatim).
- STOP immediately (do not attempt any fallback, do not retry).
3) The main agent must then:
- Print “SUBAGENT_FINISHED” and stop.
Goal: produce exactly one tool_use_error for unknown skill definitely-not-a-skill-123, with minimal other activity.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.6 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
After running (clean install) this is the contents of ~/.claude
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗