1. Credential files in your home folder
ls -ld ~/.ssh ~/.aws ~/.gnupg ~/.config/gcloud ~/.azure ~/.kube/config \
~/.docker/config.json ~/.npmrc ~/.pypirc ~/.netrc ~/.git-credentials 2>/dev/null
What it means: each line printed is a place where keys or tokens usually live. Every one of them is readable by an agent that can run cat.
2. .env files in your projects
find ~/code -maxdepth 4 -name '.env*' -not -name '*.example' -not -name '*.sample' \
-not -path '*/node_modules/*' 2>/dev/null
What it means: these are the files agents open most often by accident, usually while “understanding the project config”.
3. Keys and certificates sitting in project folders
find ~/code -maxdepth 4 \( -name '*.pem' -o -name '*.key' -o -name 'id_*' \
-o -name '*.p12' -o -name 'credentials*.json' \) -not -path '*/node_modules/*' 2>/dev/null
What it means: private keys inside a repo are one git add . or one agent read away from leaving your Mac.
4. Secrets in your shell environment
env | cut -d= -f1 | grep -iE 'key|token|secret|passw'
What it means: this prints variable names only. Agents inherit your environment, so a single env or printenv would show the values.
5. Claude Code: broad allows, bypass mode, hooks off
grep -nE 'Bash\(\*\)|"Bash"|bypassPermissions|disableAllHooks' \
~/.claude/settings.json .claude/settings.json .claude/settings.local.json 2>/dev/null
What it means: Bash(*) or a bare Bash in an allow list lets the agent run any command without asking. bypassPermissions as a default mode skips prompts entirely. disableAllHooks switches off every hook, including security ones. Run it inside a project folder to include that project’s settings.
6. Codex: approval and sandbox settings
grep -nE 'approval_policy|sandbox_mode' ~/.codex/config.toml 2>/dev/null
What it means: approval_policy = "never" means Codex never stops to ask, and sandbox_mode = "danger-full-access" removes its sandbox. Together, the agent can do anything you can.
7. Aliases that skip permissions
grep -nE 'dangerously|--yolo' ~/.zshrc ~/.zprofile ~/.bashrc ~/.bash_profile 2>/dev/null
What it means: an alias like alias cc="claude --dangerously-skip-permissions" makes the risky mode the everyday mode. That’s worth a deliberate decision, not a habit.
8. Secrets typed into shell history
grep -cE '(KEY|TOKEN|SECRET|PASSWORD)[A-Z_]*=' ~/.zsh_history ~/.bash_history 2>/dev/null
What it means: a number above zero means some secret was typed on the command line at least once and is still in a plain-text history file.
What to do with what you found
- Move secrets out of project folders where you can: a password manager’s CLI or the macOS Keychain can inject them at run time instead.
- Narrow broad allow rules to the commands you actually approve every day, such as
Bash(npm test). - Add deny rules or hooks for secret paths. Our guide How to stop Claude Code from reading your .env file walks through both.
- Clear old secrets from history, then rotate any key that was ever pasted into a terminal or chat.
Or let Warden watch these paths and commands for every agent at once. It’s free and open source (MIT).