Env
Use env when environment settings or Git ignore rules have become hard to trust. It checks how configuration is used, reports problems and lets you choose fixes or a safe template.
Flow
Start the command
Codex → $env Claude → /env
Use your client’s command prefix. Normal env starts on a clean, eligible main/master, feature or confirmed environment branch, checked before the audit. An explicitly requested read-only audit can inspect pending edits.
If a prerequisite is missing or safe inspection cannot be completed, env reports the blocker and stops. Findings already collected remain available. Resolve the blocker and rerun env for further checks or fixes.
What gets checked
| Area | Typical questions |
|---|---|
| Configuration use | Which keys are required, missing or apparently unused? Where is each environment’s configuration maintained? |
| Values and syntax | Are there credible exposures, hardcoded settings or loader-specific problems? Which settings reach distributed output? |
| Local protection | Are private files readable only by their intended users? Are Git ignore rules protecting or hiding the right files? |
The audit follows actual services and configuration layers, distinguishing the maintained source from overrides and generated copies. One production setting can serve several build consumers without a duplicate local production file; development values can intentionally differ. Public browser identifiers remain visible after moving into env. Existing safe templates are also checked for stale, duplicated or misleading guidance.
The report shows numbered issues with short explanations and readable diffs, rather than a checklist of passed checks. Paths, key names and uncertainty remain visible without exposing values.
Choose the fixes
Review the proposed environment and .gitignore fixes, then choose Apply recommended, Apply all proposed fixes or Skip. Each apply choice lists its issue numbers; when recommended includes every ready fix, only Apply all proposed fixes is shown. You can type a subset such as 1–3, 6 or request a revision without a separate menu option.
Recommendations weigh the issue’s current or conditional impact, expected benefit and tradeoffs in this project. Short- and long-term effects matter when they differ; an important issue can still need a decision before its fix is ready. Large reports use a compact index and detailed batches, with approval covering only the fixes shown for that review.
A separate scope question is needed only when the plan depends on your answer. Source/templates, local-only work and external setup stay distinct; templates use placeholders and edits preserve configuration meaning. Skip makes no changes for the current review and preserves any earlier verified work.
Template cleanup preserves useful comments and safe defaults. A missing source reference alone does not prove a key can be removed: bootstrap tools and older deployments may still need it. Removal plans keep replacement configuration available until the affected consumers are verified or explicitly confirmed ready.
You can separately authorize provider or runtime checks with named targets and effects. These are optional checks, not extra issue counts. A hosted key that cannot be read stays unverified; an unexpected difference does not trigger automatic synchronization. Verification-only work creates no source commit.
Untracking needs separate approval. It keeps the local file, but other clean copies may disappear when collaborators update. Moving or untracking a secret does not revoke it or erase its history.
Your result
You get verified changes and remaining follow-up. Operational env contents are never staged; tracked or managed env files remain report-only. Approved ignored, untracked env edits stay local.
The default audit does not start the app or contact services. Approved provider, build and functional checks are reported separately, with their tested targets and limits. Messages, migrations, provisioning and deployment retain their own explicit authorization. Work finishes on the same branch; use ship separately to publish source changes.