@atillaersezke/envguard
v1.0.6
Published
Claude CLI hook with 100% .env file protection
Downloads
904
Maintainers
Readme

How it works
you press Enter
│
▼
┌─────────────────────────────────────────┐
│ UserPromptSubmit hook fires │
│ .env ──────────────► .env.enc │
│ AES-256-GCM │
└─────────────────────────────────────────┘
│
▼
Claude runs — no plaintext secrets in context
│
▼
┌─────────────────────────────────────────┐
│ Stop hook fires │
│ .env.enc ──────────────► .env │
│ decrypted │
└─────────────────────────────────────────┘Both operations are atomic — originals are only deleted after every output file is safely written.
Install
npm install @atillaersezke/envguardHooks are registered automatically on install. Nothing else to configure.
Hooks installed
# .claude/settings.local.json
hooks:
UserPromptSubmit:
- command: node node_modules/@atillaersezke/envguard/encrypt.mjs
Stop:
- command: node node_modules/@atillaersezke/envguard/decrypt.mjsEncryption
algorithm : AES-256-GCM
key : generated once → ~/.guard/crypto.key (chmod 0600)
wire format:
- iv (12 bytes)
- auth tag (16 bytes)
- ciphertextFile targeting
matches:
pattern : "**/.env*"
excludes:
- "**/.env.example" # never touched
- "**/*.enc" # already encrypted
skipped directories:
- node_modules, .git
- dist, build, .next, out
- .venv, venv, __pycache__
- coverage, logs, tmp, temp
- vendor, public, static, .cache
- target, bin, obj, frontend, .turboRequirements
- Node.js ≥ 18
- Claude Code
- PowerShell
