anthropics / anthropics/claude-code

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

Abierto
#92,118 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:tui bug has repro platform:linux platform:wsl
Lenguaje dominante
Python
Estrellas
145k
Forks
23.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

### 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).

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, shell
Área
api, cli
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.