Skip to content

[BUG] SyntaxError: Too many arguments (65535 limit) on restart after session crash - Node.js v22.22.0 #24874

Closed as not planned

Description

@balandari

Environment

  • Claude Code Version: 2.1.37
  • Runtime: Node.js v22.22.0 (npm install, not native)
  • OS: Windows 11 x64, Intel i9-14900HX, 192GB RAM
  • Shell: Git Bash (via Claude Code's embedded bash)

Summary

After a Claude Code session crashes at ~80% context usage, restarting with claude -c fails repeatedly with a V8 engine SyntaxError at module load time. The bundled cli.js contains a 62,975-character minified line (line 2026) that exceeds V8's hard-coded 65,535 function call argument limit during ESM compilation.

Error

file:///C:/Users/Mike/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2026
[62,975 characters of minified JS dumped to terminal]

SyntaxError: Too many arguments in function call (only 65535 allowed)
    at compileSourceTextModule (node:internal/modules/esm/utils:346:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:107:18)
    at #translate (node:internal/modules/esm/loader:546:20)
    at afterLoad (node:internal/modules/esm/loader:596:29)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:601:12)
    at #createModuleJob (node:internal/modules/esm/loader:624:36)
    at #getJobFromResolveResult (node:internal/modules/esm/loader:343:34)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:311:41)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:664:25)

Reproduction Steps

  1. Run Claude Code (npm version) on Node.js v22.22.0
  2. Work in a session until context reaches ~80%+ (heavy /analyze workload, multi-file operations)
  3. Session crashes to command prompt
  4. Attempt to restart with claude -c or claude -c --dangerously-skip-permissions
  5. Restart fails with the SyntaxError above
  6. Repeat step 4 -- fails multiple times before eventually succeeding

Expected Behavior

claude -c should restart successfully after a session crash.

Impact

Blocks resuming work after a crash. Combined with the ~80% context crash pattern (see #21875), this creates a double failure: the session dies, then the tool won't restart. Had to attempt restart repeatedly before it eventually succeeded.

Analysis

The error occurs in Node.js's ESM module loader at compileSourceTextModule -- before any Claude Code logic executes. V8 has a hard limit of 65,535 (2^16 - 1) arguments per function call, enforced during bytecode compilation. Line 2026 of the bundled cli.js is a single 62,975-character minified line that apparently contains or generates a construct exceeding this limit.

The intermittent nature suggests the V8 compilation path may vary based on system state (memory pressure, module cache state) -- the same cli.js file sometimes compiles successfully and sometimes hits the limit.

Workaround

Retry claude -c repeatedly. It eventually succeeds, but may take many attempts.

Related

Note

This comment was written by Claude (Opus 4.6) on behalf of @balandari as part of our AI-assisted development workflow.

Activity

  1. ThatDragonOverThere commented on Feb 25, 2026

    @ThatDragonOverThere

    Post-Crash Corruption: The Aftermath of Bun v1.3.10 Instability

    The SyntaxError 65535 limit after a crash is another damage category from the Bun crash family. Beyond the crash itself: config file corruption (.claude.json truncated mid-write), DNS corruption, session data loss, and now this post-crash syntax corruption.

    20+ crash issues, 90 users, root cause on #21875 (N-API race condition). Zero staff response in 30+ days despite high-priority + oncall labels.

  2. github-actions commented on Mar 26, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  3. github-actions commented on Apr 3, 2026

    @github-actions

    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.

  4. locked as resolved and limited conversation to collaborators on Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions