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.

securityinfrastructure

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.

So what The change itself is four lines and the reasoning is sound. If the base `willchen96/mike` still writes `claude-raw-stream.log` unconditionally, this is worth applying to your own fork before handling any real user data. Small and low-risk to cherry-pick.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from fayerman-source/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
95cf296f fix claude raw stream logging Eli Fayerman 2026-05-04 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-310.md from inside the repo you want the changes in.

⬇ Download capture-thread-310.md