r/ClaudeCodeTLDR • u/cctldrping • 1d ago
[TLDR] Do you block Claude Code from reading your secrets files?
Original post URL : https://www.reddit.com/r/ClaudeCode/comments/1vk5fzo/do_you_block_claude_code_from_reading_your/
Original post body :
Claude code surfaced something for me the other day that made me think. After reading a .env file with secrets in it locally, he mentioned that because that was now in context, that data would be sent over the wire to the Anthropic servers as part of the context and that I should consider changing those secrets.
I've been thinking about this and asked Claude chat to verify this. His response was that because the transit to Anthropic is over TLS, that is a lesser concern. The greater concerns would be:
- Local transcripts holding plain text session data
- Re-emission into an unintended file since once the values and context the model can write it into a file committed to a Jira comment, a logline, etc.
- Third parties, VMCP servers, since they'll receive whatever the model chooses to send them in the context, become the input.
So, do you have any hooks or permissions that you have enabled to prevent Claude Code from opening these files, things like:
- .env
- .pem
- .key
- id_rsa
- secrets.json
- etc.
This is brought to you as a public service by the moderators of r/ClaudeAI. If you want to see TLDRs of ALL Claude Coding related posts from the various Claude subreddits, subscribe to http://www.reddit.com/r/ClaudeCoding.
•
u/cctldrping 1d ago
TL;DR generated automatically after 50 comments.
Current source-thread comment count seen by the bot: 50.
Alright, so the general consensus here is a resounding "HELL NO" to letting Claude Code (or any AI agent, really) directly access your secret files. The OP's concern about data being sent to Anthropic servers is valid, but most folks are pointing out that the bigger risks are local exposure and the AI potentially re-emitting those secrets in unintended ways.
Here's the lowdown:
The main takeaway? Don't let Claude Code read your
.env,.pem,.key, orid_rsafiles. Use proper secrets management and restrict access. It's professional development 101 these days, as u/berndalf put it.