anthropics / anthropics/claude-code
[Bug] Session context desync: unlogged user text received by assistant but absent from .jsonl and /export
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 147k
- Forks
- 24k
- PR merge metrics
- PR metrics pending
Description
Bug Description
【事象】
ユーザーが送信していないテキスト(約2,000字、他AIの回答を装った内容)が、
アシスタント側にはユーザー発言として届いた。
しかしセッションログ(.jsonl)にも /export にも、その発言は記録されていない。
【確認した事実】
- セッションログ 4bfc0212-a91d-425f-b49d-f6a077ff6be6.jsonl を全件検査
- 該当時刻前後のユーザー発言:
行3281 04:49:01 "中山8Rの斬新な予想してみて"
行3293 04:50:17 (assistant応答)
行3296 04:54:47 "長い"
→ 間に該当する user レコードが存在しない - 混入テキストを含むレコードは assistant 発言(引用)のみ
- /export でも行頭 "> "(ユーザー発言の印)が付いていない
【影響】
アシスタントが、存在しないユーザー発言を前提に応答した。
ユーザーが「送っていない」と指摘しても、アシスタント側は
コンテキスト上それが存在するため、2度にわたり誤って否定した。
【環境】
Claude Code / Opus 5 (1M context)
Windows 11 / D:\claude\03_keiba
発生時刻: 2026-09-20 04:49〜04:55 UTC
セッションID: 4bfc0212-a91d-425f-b49d-f6a077ff6be6
セッションログは手元にあるので、添付を求められたらこのファイルを渡せます。
C:\Users\User.claude\projects\D--claude-03-keiba\4bfc0212-a91d-425f-b49d-f6a077ff6be6.jsonl
Environment Info
- Platform: win32
- Terminal: null
- Version: 2.1.273
- Feedback ID: c3c6b218-987c-4e57-a35b-a5a915268280
Errors
[{"error":"TelemetrySafeError: VirtualMessageList: itemKeys/messages length desync (keys=826 messages=825 range=[808,826))\n at m7t (B:/~BUN/root/chunk-c5xn880r.js:37:30931)\n at awe (B:/~BUN/root/chunk-c5xn880r.js:37:21813)\n at iu (B:/~BUN/root/chunk-x70mgmyw.js:18:20017)\n at vu (B:/~BUN/root/chunk-x70mgmyw.js:18:38159)\n at vm (B:/~BUN/root/chunk-x70mgmyw.js:18:84185)\n at wb (B:/~BUN/root/chunk-x70mgmyw.js:18:83187)\n at ku (B:/~BUN/root/chunk-x70mgmyw.js:18:83016)\n at dm (B:/~BUN/root/chunk-x70mgmyw.js:18:79549)\n at Fn (B:/~BUN/root/chunk-x70mgmyw.js:18:6254)\n at ti (B:/~BUN/root/chunk-x70mgmyw.js:18:4788)","timestamp":"2026-09-19T23:46:36.070Z"}]
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with the supplied session JSONL file and the /export output, then inspect the TelemetrySafeError showing a VirtualMessageList itemKeys/messages length desync. Done means user-visible text is not delivered as an unlogged user message, session logs and /export remain consistent, and the reported desync no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100