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.
Hand Claude your heap snapshots or server code and ask it to trace memory leaks — it spots missing event listener cleanup, unbounded caches, and stream lifecycle bugs that are easy to miss in code review.
Ask Claude to audit your UI components for WCAG accessibility issues — it catches semantic problems, missing ARIA attributes, and keyboard navigation gaps that automated tools miss.
The --debug flag enables verbose logging for Claude Code, and an optional category filter like "api,mcp" lets you narrow output to exactly the subsystem you need to investigate.