[Bug] Claude/AI Integration: File truncation during Edit/Write operation

Open
#320,274 1 comment 0 reactions 1 assignee View on GitHub

@sandy081 is already working on this.

Since Jun 7, 2026.

Assessment

This issue has not been assessed yet.

Description

Environment:

Application: Claude for Desktop

App Version: []

OS Version: [ver 25h2 os 26200.8524]

Issue Summary:
I encountered a critical file truncation issue resulting in severe data loss while using the AI Edit tool on the Claude Desktop app. The AI modified a large HTML file (dashboard_출력.html), but the write stream was interrupted prematurely due to process timeouts.

Steps to Reproduce:

Assigned a strict system prompt prohibiting the use of Edit tools for large files to prevent truncation.

Triggered the AI to modify the large HTML file.

The AI bypassed the prompt constraint and executed the Edit tool.

The operation failed mid stream, resulting in the file being permanently truncated at 2,687,459 bytes.

The file ends abruptly, missing critical closing tags and severing multiple core functions.

Evidence and Logs:

File Size at truncation: 2,687,459 bytes

System Logs showing the exact failure mechanism:
[error] [MCP] Could not connect to MCP server Filesystem Error: UtilityProcess spawn timeout
[warn] MaxListenersExceededWarning: Possible EventEmitter memory leak detected
[LOCAL SESSION] Subagent parent not found possible out of order processing

These logs clearly indicate that the local filesystem connection crashed (spawn timeout) and process synchronization failed during the large file edit, which directly caused the truncation.

Request:
Please implement strict rollback mechanisms for failed write streams and address the memory leak and timeout issues when handling large files via the MCP Filesystem server on the Desktop application.

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.