[BUG] Memory crash (heap limit exceeded) when spawning fullstack-developer agent for trivial task

Resolved 💬 3 comments Opened Jan 16, 2026 by kylelogue Closed Jan 16, 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 crashes with "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory" when attempting to spawn the fullstack-developer agent for a simple, trivial UI update task (updating a few lines in a single Vue component).

The Node.js process consumes ~4GB of memory before crashing during agent initialization, which seems excessive for a task that should require minimal resources.

This makes it impossible to use the agent-based workflow recommended in CLAUDE.md for any file modifications, even trivial ones.

What Should Happen?

Spawning an agent for a trivial task (single file, few line changes) should:

  1. Complete successfully without memory errors
  2. Use reasonable memory (< 500MB for a simple task)
  3. Allow the agent-based workflow pattern to function reliably

If there are memory constraints that prevent agent spawning for trivial tasks, Claude should either:

  • Warn users before attempting to spawn the agent
  • Gracefully fall back to direct execution
  • Provide clear documentation about when agents should/shouldn't be used

Error Messages/Logs

<--- Last few GCs --->

[17234:0x110008000] 62565 ms: Scavenge 4035.9 (4124.2) -> 4031.1 (4125.5) MB, 5.6 / 0.0 ms (average mu = 0.456, current mu = 0.324) allocation failure;
[17234:0x110008000] 62578 ms: Scavenge 4037.3 (4125.5) -> 4032.4 (4142.5) MB, 6.5 / 0.0 ms (average mu = 0.456, current mu = 0.324) allocation failure;
[17234:0x110008000] 66937 ms: Mark-sweep 4046.7 (4142.5) -> 4035.0 (4147.0) MB, 4327.1 / 0.0 ms (average mu = 0.183, current mu = 0.034) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x10062d770 node::Abort() [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
2: 0x10062d954 node::ModifyCodeGenerationFromStrings(v8::Localv8::Context, v8::Localv8::Value, bool) [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
3: 0x1007841a8 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
4: 0x10092eb30 v8::internal::EmbedderStackStateScope::EmbedderStackStateScope(v8::internal::Heap*, v8::internal::EmbedderStackStateScope::Origin, cppgc::EmbedderStackState) [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
5: 0x10092d4d8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
6: 0x10092156c v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
7: 0x100921db0 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
8: 0x100907d30 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
9: 0x100ca8490 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
10: 0x100ff510c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/kylelogue/.nvm/versions/node/v18.20.4/bin/node]
[... truncated for brevity ...]
[1] 17234 abort claude

Steps to Reproduce

  1. Set up a project with a CLAUDE.md that enforces agent-based workflow for all file modifications (even trivial ones)
  2. Request a trivial UI change, e.g., "In SiteDetailView.vue, update 4 text labels"
  3. Claude correctly assesses as "Trivial" and attempts to spawn fullstack-developer agent
  4. Watch Claude Code crash with heap limit exceeded error

Task prompt used:
"In the frontend/src/views/sites/SiteDetailView.vue component, I want you to do the following:
1) Replace the 'Site Information' title with the actual domain
2) Replace the domain in the card body with 'GA4 Measurement ID'
3) Update the 'Tracker Information' button to say 'View Installation Code' with a prefixed copy icon
4) Update the buttons to take up the full width of the card footer"

Expected: Agent spawns, makes changes, completes successfully
Actual: Node.js crashes with OOM error during agent initialization

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.9

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

<img width="278" height="390" alt="Image" src="https://github.com/user-attachments/assets/9563fc40-b429-4a07-a6b5-13e2eb72dd9f" />

View original on GitHub ↗

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