env-audit

env-audit is a command for Claude Code from mertjane/awesome-claude-commands. It costs 38 tokens per session (1,206 once invoked), scanned A, original, MIT.

A command that compares an active environment-variable file with an example or template file, then reports differences and possible security problems. Environment variables are configuration values kept outside source code, such as API keys or database settings.

In plain words
What is it for?
Auditing `.env`, `.env.local`, or similar files against `.env.example`, `.env.sample`, or related templates. It helps document configuration and identify potentially unsafe values.
Why use it?
It reveals required settings that are missing, extra settings that are undocumented, and risky values such as hardcoded secrets or weak credentials. If no comparison template exists, it can still perform a security-only check when an active file is available.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Auditing .env, .env.local, or similar files against .env.example, .env.sample, or related templates. It helps document configuration and identify potentially unsafe values.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/mertjane/awesome-claude-commands/env-audit
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/mertjane/awesome-claude-commands

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for env-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/mertjane/awesome-claude-commands/env-audit/github.svg)](https://agentmods.dev/commands/mertjane/awesome-claude-commands/env-audit)
Your own site
<a href="https://agentmods.dev/commands/mertjane/awesome-claude-commands/env-audit"><img src="https://agentmods.dev/badge/commands/mertjane/awesome-claude-commands/env-audit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for env-audit

Your own site · 80×15
<a href="https://agentmods.dev/commands/mertjane/awesome-claude-commands/env-audit"><img src="https://agentmods.dev/badge/commands/mertjane/awesome-claude-commands/env-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,206 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01206
Opus 5 $0.00019 $0.00603
Sonnet 5 $0.00008 $0.00241
Haiku 4.5 $0.00004 $0.00121

Measured 10d ago against content hash 36feda76433d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

env-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/env-audit.md · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Environment Variables Audit

Audit the project's environment variable files and produce a report covering missing variables, undocumented extras, and security risks.

If $ARGUMENTS is provided, use it as the path to the active env file. Otherwise auto-detect.

Step 1 — Find Environment Files

Example/template file (source of truth) — search in order:

  1. .env.example
  2. .env.sample
  3. .env.template
  4. .env.defaults

If none found, report: "No .env.example found. Cannot perform comparison audit. Consider creating one." Then continue with security-only audit of the active env file.

Active env file — search in order:

  1. $ARGUMENTS (if provided)
  2. .env.local
  3. .env
  4. .env.development
  5. .env.development.local

If no active env file found, report it and stop.

Step 2 — Parse Both Files

Read each file line by line:

  • Skip blank lines and lines starting with #
  • Split on first =: key is everything before, value is everything after
  • Strip surrounding quotes from values ("value"value, 'value'value)
  • Collect: { key, value, hasValue: value.trim() !== "" }

Step 3 — Compare Keys

Missing variables (in example but not in active env):

  • Key exists in example but not in active env
  • Severity: ERROR — app likely broken without these

Undocumented extras (in active env but not in example):

  • Key exists in active env but not in example
  • Severity: WARNING — should be added to .env.example (without the value)

Empty variables (key exists in active env but value is blank):

  • Key present but value is empty string
  • Severity: WARNING if key looks important (contains SECRET, KEY, TOKEN, PASSWORD, URL, HOST)

Step 4 — Security Risk Analysis

For every variable in the active env file, check:

Hardcoded weak secrets:

  • Key contains: SECRET, KEY, TOKEN, PASSWORD, PASS, PWD, AUTH, CREDENTIAL
  • AND value matches any of:
    • secret, password, 123456, test, dev, development, changeme, example, placeholder, your_*, replace_*, xxx, todo
    • Value shorter than 16 characters for secret/token fields
  • Severity: HIGH — replace with a strong random value

Read the full file on GitHub · 143 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 143 lines · 38 tokens per session scan A 36feda76433d

Subscribe to this mod's changes

env-audit is a command published in the GitHub repository mertjane/awesome-claude-commands (2 stars, last pushed 6mo ago), licensed MIT. It adds 38 tokens to every session and 1,206 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.