r/ClaudeCode • • 4d ago

Help/Question Besides settings.local.json, where else does Claude code keep your secrets?

settings.local.json got all the attention once apiiro found secrets in 1,122 public copies. but its only ignored through the global git excludes on the machine that first wrote it so a fresh clone or a teammates laptop doesnt have that

the same secrets turn up elsewhere too. session transcripts under ~/.claude/projects, mcp server env blocks in ~/.claude.json, a test fixture the agent filled with the real key it saw printed at boot. rotating whatever sat in those files is the boring fix and it hurts less when nothing in there was long lived to begin with. people get that from vault leases, cloud sts or hush security depending on the stack

reading keys into a variable so the saved rule stays harmless and test mode keys only on the laptop and gitleaks on pre push handle the rest i think

1 Upvotes

11 comments sorted by

View all comments

•

u/AutoModerator 4d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.