claude --bare -p hi writes 1 line to ~/.claude/projects/<key>/<uuid>.jsonl where node writes 5. At scale: -p with 1 MB of stdin → node 2,409,463 B, perry 1,195,651 B. So --resume/--continue have little to resume.
This is NOT #9403
I originally filed it as a suspected consequence of process.on("exit") never firing. That premise is wrong, and here is the disproof: snapshotting the transcript from a prependListener("exit", …) under node shows all five records are already on disk before the first exit listener runs. Exit hooks are not involved.
Where the divergence actually is
The four records perry misses go through the session writer's async insertQueueOperation → flush path (Ng1 / x_() in the bundle). The one record perry does write — last-prompt — is a direct appendFileSync.
So the failing shape is: work enqueued asynchronously and flushed before exit is lost. Sync writes land. That is an async-flush / drain divergence, independent of the exit-event machinery fixed in #9420.
Suggested starting point
Compare, under both engines, when the queued flush actually runs relative to loop drain — a promise/microtask scheduling difference, an unawaited write, or a drain that exits before the queue empties would all produce exactly this. Note #9412 (nextTick demoted below promise microtasks after any builtin require) is a live scheduling divergence in the same neighbourhood and may be the mechanism.
Found by a differential stress-test of claude-code under perry; disproof of the #9403 premise came from #9420's verification work.
claude --bare -p hiwrites 1 line to~/.claude/projects/<key>/<uuid>.jsonlwhere node writes 5. At scale:-pwith 1 MB of stdin → node 2,409,463 B, perry 1,195,651 B. So--resume/--continuehave little to resume.This is NOT #9403
I originally filed it as a suspected consequence of
process.on("exit")never firing. That premise is wrong, and here is the disproof: snapshotting the transcript from aprependListener("exit", …)under node shows all five records are already on disk before the first exit listener runs. Exit hooks are not involved.Where the divergence actually is
The four records perry misses go through the session writer's async
insertQueueOperation→flushpath (Ng1/x_()in the bundle). The one record perry does write —last-prompt— is a directappendFileSync.So the failing shape is: work enqueued asynchronously and flushed before exit is lost. Sync writes land. That is an async-flush / drain divergence, independent of the exit-event machinery fixed in #9420.
Suggested starting point
Compare, under both engines, when the queued flush actually runs relative to loop drain — a promise/microtask scheduling difference, an unawaited write, or a drain that exits before the queue empties would all produce exactly this. Note #9412 (
nextTickdemoted below promise microtasks after any builtinrequire) is a live scheduling divergence in the same neighbourhood and may be the mechanism.Found by a differential stress-test of claude-code under perry; disproof of the #9403 premise came from #9420's verification work.