anthropics / anthropics/claude-code
[BUG] Large pasted user messages are silently truncated mid-content with no warning
- Lingua principale
- Python
- Stelle
- 145k
- Fork
- 23.1k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
### 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).
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, shell
- Ambito
- api, cli
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100