[Bug] User input queued during assistant turn appears in context without session persistence

Status Open
Reported on v2.1.222
Maintainer reply None cached
Activity 0 comments · opened Aug 5, 2026

Bug Description
증상 — 사용자가 입력하지 않은 텍스트가 사용자 메시지 자리에 나타나고, 모델이 그것을 실제 입력으로 처리함

발생 상황

  1. 어시스턴트가 응답을 마치고 같은 턴에서 도구 호출을 이어감
  2. 사용자가 그 도중 입력하거나 Esc 로 중단
  3. 세션 기록(jsonl)에 없는 짧은 텍스트(undone, 했다)가 화면과 모델 컨텍스트에 사용자 발화로 등장
  4. 모델이 그것을 승인·완료 신호로 읽고 다음 작업을 실행

확인 방법
~/.claude/projects/<프로젝트>/<세션>.jsonl 에서 해당 구간의 type: "user" 항목을 보면, 그 텍스트를 담은 항목이 없음. queue-operation 타입 항목이 근처에 있음.

재현 조건 (추정)
어시스턴트 턴이 끝나기 전 사용자 입력이 큐에 들어갈 때. 두 번 다 [Request interrupted by user] 또는 중단 직후에 발생.

영향
모델이 없는 승인을 받은 것으로 판단해 실제 데이터를 만들거나 외부 요청을 보냄. 이 세션에서는 테스트 DB 에 데이터가 생성됨.

환경
Claude Code / macOS 15 (Darwin 25.4.0) / Opus 5

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.222
  • Feedback ID: dc583207-b511-439f-bd2b-25d4a92b03c1

Errors

[]

---

Phantom user messages appear when input is queued during an assistant turn

Summary

Text that the user never typed shows up as a user message, and the model treats it as a real instruction. Twice in one session (undone, 했다), the model read these as approval/completion signals and executed
follow-up work — including writes to a database and outbound HTTP requests.

Steps to reproduce (observed twice, not deliberately reproduced)

  1. Assistant finishes a text response and continues issuing tool calls in the same turn.
  2. User types something or presses Esc while those tool calls are running.
  3. A short string appears in the transcript as a user message.
  4. The model interprets it as a reply to its last question and proceeds.

Evidence

The session log at ~/.claude/projects/<project>/<session>.jsonl contains no type: "user" entry for that text. In both cases the surrounding entries were:

[assistant] text — "…pull 하시면 검증하겠습니다"
[assistant] tool_use: Bash ← no user entry in between
[user] tool_result
[assistant] tool_use: Bash
[queue-operation] (content: null) ← user began typing here
[user] tool_result

queue-operation entries with null content sit next to both occurrences. The phantom text first appears in the transcript only when the user later pasted their screen to ask what it was.

Impact

The model acted on approval that was never given:

  • Created rows in a test database
  • Sent HTTP requests to an external server
  • Reported to the user that a step ("pull") had completed when it had not

Suspected cause

Input queued while an assistant turn is still streaming may be committed into the message array without a corresponding log entry.

Environment

Claude Code, macOS 15 (Darwin 25.4.0), model Opus 5. UserPromptSubmit hook configured.

Suggested check

Compare the in-memory message array against the jsonl writer when queue-operation fires mid-turn.

View original on GitHub ↗