Run /doctor to Validate Your Claude Code Environment
Something's not working right, but you're not sure if it's your prompt, your code, or your setup. /doctor cuts through the guesswork and checks your Claude Code environment in one shot.
/doctor
It validates your API key, checks that the selected model is accessible, confirms tool availability, and surfaces any configuration issues — all at once.
It's the first thing to run when Claude starts behaving unexpectedly, especially after:
- Updating Claude Code to a new version
- Rotating or changing your API key
- Switching machines or dev containers
- Modifying your config files
# You can also run it without entering interactive mode
claude /doctor
The output will tell you exactly what's wrong — whether it's an expired API key, a missing model permission, or a misconfigured tool. Most setup issues have a clear fix once you know which layer is broken.
Before spending 20 minutes debugging your prompt, spend 5 seconds debugging your environment.
Run /doctor before blaming your prompt — it might just be a stale API key.
Log in to leave a comment.
When a page takes five seconds to load or an API endpoint times out under load, tell Claude which route is slow and it traces the entire code path — controller, services, queries, loops — identifying N+1 queries, redundant computations, missing indexes, and cacheable operations, then fixes each bottleneck.
Flaky tests are maddening — they pass locally, fail in CI, pass again when you retry. Tell Claude to read the test, identify the source of non-determinism — timing issues, shared state, date dependencies, or order-dependent setup — and fix the root cause so the test is reliably green or reliably red.
When your app throws an error, don't just Google the message — paste the full stack trace into Claude Code. It reads the trace, opens the referenced files in your codebase, follows the call chain, and pinpoints the actual root cause instead of just explaining the symptom.