Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add qdhenry/Claude-Command-Suite --skill audit-env-variables -a claude-code
Open on GitHub

What 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 .env variable 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-code

2Manually: put the files in place

~/.claude/skills/audit-env-variables/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/audit-env-variables/

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.

Similar skills

All skills for Security →

From the same set112

The whole set →
audit-ports-adapters The audit-ports-adapters command audits ports and adapters in Rust code, checking trait placement, implementations, and whether use cases depend on abstractions. CX Codex +1 ★ 1,357repo stars project-architect project-architect analyzes project requirements, recommends a tech stack, and scaffolds folder structure for new projects or architecture refactoring. Handles web apps, microservices, monorepos, and backend services. CX Codex ★ 1,357repo stars parallel-tasks parallel-tasks pulls task queues from issue trackers and assigns independent items across multiple parallel agents without file conflicts. CX Codex +1 ★ 1,357repo stars code-reviewer-pro code-reviewer-pro — a Claude Code subagent that reviews code for quality, security and best practices. Runs right after you write or modify code. CX Codex ★ 1,357repo stars release-manager release-manager handles SemVer bumps, drafts changelog records, and verifies checklists before production deployment. CX Codex ★ 1,357repo stars incremental-feature-build The incremental-feature-build command breaks a request into testable features, tracks progress in project files, and works through features one at a time. Use it for multi-stage implementation tasks. CX Codex +1 ★ 1,357repo stars spec-workflow-setup spec-workflow-setup — a slash command that walks you through wiring the spec-workflow MCP server into Claude: dependencies, .mcp.json, .spec-workflow.json, then a connection check. CX Codex +1 ★ 1,357repo stars audit-clean-arch audit-clean-arch audits a Rust codebase against Clean Architecture rules. It locates improper layer dependencies, framework leaks, and concrete adapter couplings. CX Codex +1 ★ 1,357repo stars

Project sponsors

Companies that keep this analytics open