[BUG] 03-BUG-session-crash-rapid-large-posts

Resolved 💬 3 comments Opened Nov 16, 2025 by energyscholar Closed Nov 19, 2025

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?

Bug Report: Unrecoverable Session Crash from Rapid Large Posts

Reported: 2024-11-12
Severity: HIGH - Complete session loss, no recovery
Component: Session Management / Message Queue
Status: Ready for submission

---

Summary

Claude Code session crashed irrecoverably after user posted ~10 consecutive large text blocks in rapid succession. Session remained unresponsive despite strong WiFi and extended wait time. Required force-close.

---

Environment

Device:       Acer Chromebook Plus 514
OS:           ChromeOS + Debian Linux container
Browser:      Chrome (ChromeOS native)
Claude Code:  2.0.37
Network:      Poor WiFi → Strong WiFi (tested both)
Session:      Long-running, background tab

---

Reproduction Steps

  1. Start Claude Code session (allow to run extended period)
  2. Scrape large text content into ~10 separate chunks (~5KB each)
  3. Paste chunks rapidly one after another
  4. Observe initial responses (Claude processes first 2-3 normally)
  5. Session stops responding
  6. Wait several minutes - no recovery
  7. Move to strong WiFi - no recovery
  8. Force-close tab

Trigger Content:
Historical text scraped from archive.org (Sarnath Software 1995-1999), split into ~10 rapid sequential pastes.

Control:
Same content posted as single consolidated file works fine. Issue triggered by rapid sequential posting specifically.

---

Expected Behavior

  • Handle multiple large posts gracefully
  • Show rate limiting message if needed: "Processing previous messages, please wait..."
  • Maintain session responsiveness
  • Graceful degradation under load
  • Recoverable errors (not crash)

---

Actual Behavior

Timeline:

  1. Posts 1-3: Claude responds normally with quality analysis
  2. Posts 4-10: Session becomes unresponsive mid-processing
  3. Complete crash: UI frozen, no error message, no recovery
  4. Network change: Moving to strong WiFi has no effect
  5. Time: Waiting 5+ minutes has no effect
  6. Resolution: Force-close tab (total context loss)

Sample Response Before Crash:

This is absolutely remarkable.

Sarnath Software in 1995-1999 had:
✅ System-agnostic VTT (works with any RPG)
✅ Voice communication during gameplay (in the 1990s!)
✅ Publisher partnership (Steve Jackson Games!)
...

Then crashed after subsequent posts.

---

Analysis

Root Cause Hypotheses

  1. Message Queue Overflow - Frontend accepts input faster than backend processes
  2. Memory Exhaustion - Large text blocks accumulate without GC
  3. Context Window Breach - Token limit exceeded without graceful handling
  4. WebSocket Backpressure - Connection saturated, no flow control
  5. Browser Tab Throttling - Background tab + heavy processing = crash

Network Ruled Out

  • Session crashed on poor WiFi
  • Remained crashed after moving to strong WiFi
  • Successfully wrote this bug report on same poor WiFi
  • Conclusion: Backend/frontend issue, not network transport

---

Impact Assessment

Severity: HIGH

  • Data Loss: Entire session context lost (hours of work)
  • No Recovery: Cannot resume, reload, or export
  • Unpredictable: Unclear threshold (10 posts? 50KB total? Rate?)
  • User Trust: Fear of session instability inhibits usage
  • Workflow Disruption: Forces external text preprocessing

Affected Use Cases:

  • Research (posting multiple documents)
  • Migration (pasting config files, logs, schemas)
  • Debugging (posting stack traces, logs, error output)

---

Suggested Fixes

1. Input Rate Limiting with Feedback

User posts message → Queue depth check → If queue > threshold:
  - Disable input field
  - Show: "Processing 3 pending messages..."
  - Re-enable when queue clears

2. Backpressure Management

  • Limit pending message queue size (e.g., 3 messages max)
  • Process messages sequentially, not concurrently
  • Stream large inputs (don't buffer entirely in memory)

3. Graceful Degradation

  • Monitor context window usage
  • Warn at 80%: "Approaching context limit (80K/100K tokens)"
  • Offer summary/compression at 90%
  • Hard stop at 100% with clear error

4. Session Recovery

  • Autosave session state to localStorage
  • Detect crash/reload → offer "Resume previous session?"
  • Export session before risky operations

5. Error State UI

  • If WebSocket drops: show reconnection status
  • If backend timeout: show spinner with timeout countdown
  • If unrecoverable: offer session export before close

---

Reproduction Test Case

// QA Test: Rapid Large Message Handling
test('session-stability-under-rapid-large-posts', async () => {
  const session = await startClaudeCodeSession();
  const largeText = generateText(5000); // 5KB blocks

  // Simulate rapid posting (10 blocks in <10 seconds)
  for (let i = 0; i < 10; i++) {
    await session.postMessage(largeText);
    await sleep(500); // 500ms between posts
  }

  // Session must remain responsive
  expect(session.isResponsive()).toBe(true);

  // All messages must eventually process (or gracefully reject)
  await session.waitForCompletion(timeout=60000);
  expect(session.getResponseCount()).toBeGreaterThanOrEqual(1);
  expect(session.hasError()).toBe(false);
});

---

Additional Context

Session State:

  • Long-running session (hours)
  • Background tab (Chrome may throttle)
  • Multiple prior interactions (context window partially filled)

Content Characteristics:

  • Text-only (no binary data)
  • Publicly archived (archive.org)
  • Replicable (can provide exact content if needed)

User Behavior:

  • Legitimate use case (research/analysis)
  • Not attempting to exploit or DOS
  • Surprised by crash (expected rate limiting at worst)

---

Related Issues

This may connect to:

  • Token limit handling
  • WebSocket connection management
  • Frontend state management (React/Vue?)
  • Browser tab lifecycle (background throttling)
  • Memory management (large message buffering)

---

Submission

GitHub: https://github.com/anthropics/claude-code/issues
Issue URL: ____________________ (fill after submission)

Attachments Available:

  • Exact text content that triggered crash
  • Approximate timestamp
  • Browser console logs (if available)

---

Contact: @energyscholar on GitHub
Project: Traveller Combat VTT
File: /home/bruce/software/bug_reports_claude/03-BUG-session-crash-rapid-large-posts.md

What Should Happen?

See full report

Error Messages/Logs

Steps to Reproduce

See report

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.37 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Also uploading file created with Claude's help. Duplicate content in file form.

03-BUG-session-crash-rapid-large-posts.md

View original on GitHub ↗

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