r/coolgithubprojects • u/fajarhide • 3h ago
Claude Code hooks that stop your coding agent from sending your .env and keys to the model provider - no-leaky
https://github.com/fajarhide/no-leaky
0
Upvotes
0
u/fajarhide 3h ago edited 49m ago
author here. i told my coding agent not to read .env and it kept doing it anyway through normal steps,
cat .envto check one setting,docker inspecton a crashing container,ps auxto find a process,git showon a commit with a key in it. everything the agent sees goes to the providerso i wrote hooks for claude code
measured with headless claude code on projects seeded with fake keys, 18 of 30 sessions leaked a key without the hooks and 0 of 30 with them, and 27 of 30 still got the right answer. on my own machine over 18 days no real secret reached the model through bash or read. one did through an mcp upload tool that returned a presigned url, that one is fixed now
install with
npx skills add fajarhide/no-leaky -gthen ask the agent to "set up the no-leaky hooks". MIT, python stdlib only. it stops accidents, not an agent that's actively trying, and the readme lists the limits. where would it get in your way?