audit-env-variables — Claude Code skill: what it does, how to install
audit-env-variables scans environment variables in a JS/TS codebase, flags unused ones, guesses the service behind each variable name, and maps where it's referenced in code.
no license ★ 1,357 updated 2026-03-01
npx skills add qdhenry/Claude-Command-Suite --skill audit-env-variables -a claude-codeWhat audit-env-variables does
The skill reads .env* files in the project root and matches declared variables against their usage in code, covering process.env., import.meta.env. and destructuring. It sorts results into variables that are used, unused, or referenced in code but missing from any .env file.
Based on naming patterns it identifies the likely service behind a variable, such as Stripe, AWS or Supabase, and assigns a rough access level, from low-risk public keys up to critical credentials with full account control. For every variable still in use, it lists the exact files and lines where it appears.
Run with --cleanup, the skill also checks for dynamic lookups like process.env[variableName], Object.keys(process.env) or a spread over process.env before treating anything as dead code. It backs up the .env files, asks for confirmation through AskUserQuestion, then runs the build or tests and rolls back if something breaks. Variables defined in .env.example are left untouched, since that file doubles as documentation.
What it helps with
- spot environment variables that are declared but never used
- identify which service a variable belongs to and how sensitive it is
- check whether every
.envvariable is documented in.env.example - remove dead environment variables with a backup and automatic rollback
- map out where each environment variable is read in the codebase
Example prompts for the agent
- Audit the environment variables in this project and write the report to ENV_AUDIT.md
- Run audit-env-variables with --cleanup and remove the unused variables
- Check which variables in .env are unused in the code and show the access level for each
How to install audit-env-variables
1Skills CLI (Vercel)
npx skills add qdhenry/Claude-Command-Suite --skill audit-env-variables -a claude-code2Manually: put the files in place
~/.claude/skills/audit-env-variables/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/audit-env-variables/
1Skills CLI (Vercel)
npx skills add qdhenry/Claude-Command-Suite --skill audit-env-variables -a codex2Manually: put the files in place
.agents/skills/audit-env-variables/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add qdhenry/Claude-Command-Suite --skill audit-env-variables -a cursor2Manually: put the files in place
.cursor/skills/audit-env-variables/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install qdhenry/Claude-Command-Suite .claude/skills/audit-env-variables2Manually: put the files in place
.github/skills/audit-env-variables/SKILL.md1Skills CLI (Vercel)
npx skills add qdhenry/Claude-Command-Suite --skill audit-env-variables -a gemini-cli2Platform CLI
gemini skills install https://github.com/qdhenry/Claude-Command-Suite --path .claude/skills/audit-env-variablesManually: put the files in place
.devin/skills/audit-env-variables/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about audit-env-variables
How do I install audit-env-variables in Claude Code?
Run npx skills add qdhenry/Claude-Command-Suite --skill audit-env-variables -a claude-code; the skill lands at ~/.claude/skills/audit-env-variables/SKILL.md.
What does audit-env-variables do?
It audits environment variables in a JS/TS project, flagging unused ones, guessing the service and access level behind each variable name, and documenting where each is used in the code. It can also remove unused variables with a regression check if asked.
Is it safe to let this skill delete environment variables?
Before removing anything it scans for dynamic process.env access, backs up the .env files, asks the user to confirm each deletion, and rolls back if the build or tests break afterward. It never touches variables defined in .env.example.