Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Blocks access to .env files, preventing accidental exposure of sensitive environment variables.
.env files contain secrets like API keys, database credentials, and other sensitive configuration. AI coding assistants that read these files could:
This plugin prevents direct access to .env files while providing a safe alternative for inspecting environment configuration.
Commands that would read .env file contents:
cat .env # Blocked
less .env.local # Blocked
grep API_KEY .env # Blocked
vim .env.production # Blocked
head -n 5 .env # Blocked
source .env # Blocked
. .env # Blocked (dot sourcing)
Direct file reads of .env files:
Read: .env # Blocked
Read: /path/to/.env.local # Blocked
Read: .env.development # Blocked
ls -la .env # Allowed (metadata only)
mv .env .env.backup # Allowed (doesn't read contents)
cp .env .env.backup # Allowed
touch .env # Allowed
git commit -m "update .env" # Allowed (just message text)
echo "update .env file" # Allowed
Files meant to show the expected format without actual secrets:
.env.example # Allowed
.env.template # Allowed
.env.sample # Allowed
.env.dist # Allowed
Instead of reading .env files directly, use the env-safe CLI to inspect them safely.
The CLI is included in the plugin at scripts/env_safe.py. Run it with uv:
uv run plugins/env-protection/scripts/env_safe.py <command>
Or make it executable and run directly:
chmod +x plugins/env-protection/scripts/env_safe.py
./plugins/env-protection/scripts/env_safe.py <command>
# List all variable names (without values)
env-safe list
# Show value status (set/empty)
env-safe list --status
# Use specific file
env-safe list -f .env.local
Example output:
API_KEY (set)
DATABASE_URL (set)
DEBUG (set)
EMPTY_VAR (empty)
# Check if a variable exists
env-safe check API_KEY
# Check in specific file
env-safe check DATABASE_URL -f .env.production
Example output:
API_KEY: exists (set)
env-safe count
Example output:
Total: 4 variables
Set: 3
Empty: 1
env-safe validate
Example output (valid):
Valid: .env has no syntax issues
Example output (with issues):
Errors:
Line 5: Invalid syntax
Warnings:
Line 3: API_KEY has unquoted value with spaces
Enable the plugin in your Claude Code settings:
{
"plugins": ["env-protection"]
}
Or install from the marketplace:
claude plugins install env-protection
No configuration needed. The plugin automatically blocks .env file access for Bash and Read tools.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub steeef/claude-hooks --plugin env-protectionPlugins from other owners that cover similar ground