When you type a message while Claude Code is still working, Claude Code does not write a separate "type": "user" line for it. It stores the message as an attachment of type queued_command and absorbs it into the running turn:
{"type": "attachment", "timestamp": "...", "attachment": {"type": "queued_command", "prompt": "I just created it", "commandMode": "prompt", "origin": {"kind": "human"}, "source_uuid": "...", "timestamp": "..."}}
_parse_jsonl_file skips every line whose type is not user or assistant, so these prompts never reach the transcript. In practice they are often course corrections ("stop, not that file"), so the rendered transcript shows Claude changing direction with no visible reason.
How often this happens: in two long sessions of mine, 19 of 246 human messages (7.7%) were sent mid-turn and would be dropped.
Minimal reproduction: a JSONL file with one user line, one assistant line and the attachment line above. The queued prompt is missing from the output.
Task notifications use the same attachment with commandMode: "task-notification". Those are not human input and should stay out.
When you type a message while Claude Code is still working, Claude Code does not write a separate
"type": "user"line for it. It stores the message as anattachmentof typequeued_commandand absorbs it into the running turn:{"type": "attachment", "timestamp": "...", "attachment": {"type": "queued_command", "prompt": "I just created it", "commandMode": "prompt", "origin": {"kind": "human"}, "source_uuid": "...", "timestamp": "..."}}_parse_jsonl_fileskips every line whosetypeis notuserorassistant, so these prompts never reach the transcript. In practice they are often course corrections ("stop, not that file"), so the rendered transcript shows Claude changing direction with no visible reason.How often this happens: in two long sessions of mine, 19 of 246 human messages (7.7%) were sent mid-turn and would be dropped.
Minimal reproduction: a JSONL file with one
userline, oneassistantline and theattachmentline above. The queued prompt is missing from the output.Task notifications use the same attachment with
commandMode: "task-notification". Those are not human input and should stay out.