⌨️DEBUG Variable
Also known as DEBUG=1, CLAUDE_CODE_DEBUG_LOGS_DIR, CLAUDE_CODE_DEBUG_LOG_LEVEL
Set to 1, it turns on debug logs, like --debug.
Think of it like
It is like you turn on the black box on a plane.
Example
Lucy's MCP server will not connect, and the screen says little. She starts with DEBUG=1 and reads the log to find the error.
Why it matters
The log shows steps the screen hides. It is the first place to look when something breaks.
Definition
Example code
bash
DEBUG=1 CLAUDE_CODE_DEBUG_LOG_LEVEL=verbose claudeCommon mistake
Key takeaways
- 11, true, yes, on. Turn it on.
- 2File per session. In ~/.claude/debug.
- 3Level and path. Two helpers.