Raw Claude stream logging gated behind DEBUG_LLM_STREAM flag
fayerman-source proposed removing the unconditional write of `claude-raw-stream.log` and replacing it with a debug flag. The concern was concrete: raw stream events carry user prompts and document context, and writing every event to an unbounded plaintext file is unnecessary data retention in a legal workflow context.
The diff in backend/src/lib/llm/claude.ts removes the fs and path imports, drops the RAW_STREAM_LOG_PATH constant, and wraps the streamEvent handler in an if (DEBUG_LLM_STREAM) guard. The fs.appendFile call that was logging every event to disk goes away entirely. Setting DEBUG_LLM_STREAM=true restores console output via console.debug for anyone who needs it.
Before this change, every chat session was writing a growing plaintext file containing prompts, uploaded document content, and assistant output. On a machine handling real client files, that file would accumulate indefinitely with no rotation or access controls.
The PR was closed without merging on 2026-05-10, six days after it opened. Whether the underlying retention concern was addressed another way or left open is not stated in the PR.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?