anthropics / anthropics/claude-code

[BUG] Large pasted user messages are silently truncated mid-content with no warning

未关闭
#92,118 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:tui bug has repro platform:linux platform:wsl
主要语言
Python
星标
145k
派生
23.1k
PR 合并指标
PR 指标待抓取

描述

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) 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?

When a pasted message (e.g., a large JSON payload copied from an API response, followed by additional instructions/text below it) exceeds the message size limit (~50,000 characters), the message is silently truncated. Everything after the cutoff point is discarded with no error, no warning, and no indication to the user that content was lost.

### What Should Happen?

Actual behavior:

The message is cut off silently at the character limit.
The trailing content (in my case, ~15 minutes of typed instructions listing next steps) is permanently lost — not stored anywhere, not recoverable.
Neither the user nor Claude is notified that truncation occurred. Claude only discovers it indirectly (e.g., a system-reminder tag ending abruptly, or the message obviously trailing off), and only after the fact.
Expected behavior:

Something that fails loudly or degrades gracefully instead of silently dropping content, for example:

Reject the paste/submission upfront with a clear "message exceeds character limit" error before it's sent, so the user can shorten it or split it up themselves, or
Auto-detect large pasted blocks and offer to save them as an attached file instead of inlining them in the message, or
At minimum, surface a visible warning/indicator when truncation happens, so the user knows immediately rather than losing work silently.

### Error Messages/Logs

```shell
[Message truncated - exceeded 50,000 character limit]

Your message looks like it got cut off, though — the pasted JSON hit the message size limit, so whatever you asked right after it didn't come through. What did you want me to do with this result?
```

### Steps to Reproduce

Copy a large block of text/JSON (~50k+ characters) into the input.
Add additional instructions or questions after that block in the same message.
Submit the message.

### Claude Model

None

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.260

### Platform

Anthropic API

### Operating System

Ubuntu/Debian Linux

### Terminal/Shell

WSL (Windows Subsystem for Linux)

### Additional Information

Silent data loss of user-authored content is a serious trust problem — the user has no way to know their message was incomplete until well after submission, by which point the original text may not be recoverable (e.g., if not kept in clipboard/undo history).

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start at the terminal input path that accepts pasted messages and trace where the ~50,000-character limit is applied. Reproduce with a 50k+ JSON block followed by text; done means the client rejects it with a clear error or visibly warns before or when truncation occurs, without silently discarding the suffix. No file or test is identified in the report.

由索引模型根据 Issue 内容生成。

评估

技术栈
python, shell
领域
api, cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。