[BUG] Code disappears when clicking Continue button after generation stops

Resolved 💬 4 comments Opened Dec 2, 2025 by frostywombat4-eng Closed Feb 3, 2026

Preflight Checklist

  • [ ] I have searched existing issues and this hasn't been reported yet
  • [ ] 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?

Title: Code disappears when clicking Continue button after generation stops
Description:
Bug Description
When Claude Code generates a large amount of code and stops (reaches output limit), clicking the "Continue" button causes all previously generated code to disappear instead of continuing the generation.
Steps to Reproduce

Start Claude Code in a project directory
Request generation of a large code file (e.g., "create a complex React component with multiple features")
Wait for Claude Code to stop generating (reaches output limit)
Click the "Continue" button
All previously written code disappears

Expected Behavior
When clicking "Continue", Claude Code should:

Preserve all previously generated code
Continue generation from where it stopped
Append new code to existing output

Actual Behavior

All previously generated code is lost
Generation starts fresh or shows empty output
User has to request the code again from scratch

Environment

OS: Windows 11
Installation method: npm (npm install -g @anthropic-ai/claude-code)
Claude Code version: [2.0.56 (Claude Code)]
Node version: [v22.18.0]

Impact
This bug significantly disrupts workflow when working with large codebases, as users:

Lose significant amounts of generated code
Must restart tasks multiple times
Cannot reliably work on complex, multi-file projects

Workaround
Currently using smaller code requests to avoid hitting the output limit, but this is inefficient for large tasks.
Additional Context
Similar issues reported:

Issue #1134 (stopping/continue behavior)
Issue #1632 (forgetting context)

What Should Happen?

When Claude Code reaches its output limit and stops generating code, clicking the "Continue" button should:

Preserve all previously generated code - Nothing that was already written should be lost or deleted
Resume generation seamlessly - Continue writing code from the exact point where it stopped
Append new content - Add new code below the existing content, maintaining proper file structure and context
Maintain conversation context - Remember what was being built and continue with the same task
Show clear progress indication - Display that generation is continuing, not restarting

Example scenario:

Claude generates 500 lines of code, then stops
User clicks "Continue"
Claude should add lines 501, 502, 503... keeping lines 1-500 intact
Final result: Complete, uninterrupted code file

This is the standard behavior in the web interface (claude.ai) and should work the same way in Claude Code CLI.

Error Messages/Logs

Steps to Reproduce

Вот что написать в поле "Steps to Reproduce":

Steps to Reproduce:

Install Claude Code via npm:

bash npm install -g @anthropic-ai/claude-code

Authenticate with Claude account:

bash claude auth
(Select option 1: Claude account with subscription)

Navigate to any project directory:

bash cd C:\your\project\folder

Start Claude Code and request a large code generation task:

bash claude "Create a complete React component with the following features: user authentication form, input validation, error handling, loading states, API integration, and responsive design with Tailwind CSS"

Observe Claude Code generating code (typically 200-500+ lines)
Wait for generation to stop automatically (you'll see the generation pause/stop, likely due to output token limit)
Click or press the "Continue" button/command when prompted
Observe the bug: All previously generated code disappears from the output instead of continuing

Expected result: Code generation should resume and append to existing code
Actual result: All generated code is lost, output is empty or starts fresh
Frequency: This happens consistently whenever code generation exceeds the output limit and Continue is used

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.56 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Ах, извините за путаницу! Тогда нужно исправить багрепорт:

Additional Information:
Workarounds currently using:

Breaking large requests into smaller chunks (less efficient)
Copying generated code immediately before it reaches the limit
Considering using CLI version of Claude Code instead

Potentially related issues:

#1134 - Claude stops and requires "keep going" command
#1632 - Claude forgets incomplete TODOs and stops
#10239 - Chat history disappears line by line

System specifications:

Browser: Chrome
OS: Windows 11
RAM: 16GB RAM

Impact severity:
This is a critical bug for professional development work because:

Loss of work (generated code is completely lost)
Disrupts workflow significantly
Makes web Claude unreliable for large/complex code generation tasks
Forces users to break down tasks into very small pieces

Important note: This issue occurs specifically in the WEB VERSION (claude.ai) when using Artifacts for code generation. The CLI version (claude code terminal tool) may not have this issue.
Reproduction context:

Using Artifacts for code generation
Generating large code files (200+ lines)
Code generation stops mid-way (hits token/output limit)
Clicking "Continue" button in the web UI
All previously generated code in the Artifact disappears

Question: Is this a known limitation of Artifacts? Should I use a different approach for large code generation tasks?

View original on GitHub ↗

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