Ask Claude to Document Every Environment Variable Your App Actually Uses
Environment variables are the most under-documented part of any project. The .env.example file lists names and placeholder values, but never explains what they do, which are required, or what breaks if they're wrong. Claude reads your code and writes the documentation.
Search the entire codebase for every environment variable reference
(process.env, env(), getenv, os.environ). For each one, document what
it controls, where it's used, whether it's required, and what the
default value is if not set.
Claude produces a clear reference:
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| DATABASE_URL | Yes | — | PostgreSQL connection string |
| REDIS_URL | No | localhost:6379 | Redis cache connection |
| MAIL_FROM | Yes | — | Sender address for transactional emails |
| RATE_LIMIT_PER_MINUTE | No | 60 | API rate limit per authenticated user |
| FEATURE_NEW_CHECKOUT | No | false | Enable the new checkout flow |
Target specific documentation needs:
# Find undocumented variables
Compare the env vars used in code against what's in .env.example.
Which ones are referenced in code but missing from the example file?
# Group by subsystem
Document the env vars grouped by what they configure — database, cache,
mail, auth, feature flags, third-party services.
# Add validation hints
For each variable, note the expected format — is it a URL, a number,
a boolean, a comma-separated list? This helps catch config errors
before they cause runtime failures.
After generating the docs, ask Claude to keep them in sync:
Add this env var documentation as a section in the README.
Also update .env.example with comments explaining each variable.
Undocumented environment variables are configuration landmines — let Claude find every one and explain what it does before someone misconfigures it.
via Claude Code
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.