Its weird being one of the only people who has ever actually read the Claude code source.
Boris cherny, lead claude code dev: "Historically Claude Code has not done secret scrubbing"
Meanwhile, secretScanner.ts, which is wired into the main file edit and write tools, but like everything in Claude code, its an elaborate, single-use feature that doesn't work and despite being called on every file edit, dynamically importing its dependencies every time, it is just hardcoded not to do anything for any file that isn't a "team memory": https://git.jon-e.net/jonny/claude-code/src/commit/59a215da280cb4d2147f39f55c3bdb5779113ccc/src/services/teamMemorySync/secretScanner.ts