Skip to content
BENIBIX Learn

DEBUG Variable

AI⌨️ Claude CodeConfiguration

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

DEBUG set to 1 turns on debug mode, the same as --debug. Logs go to a file in your debug folder, one per session. Only 1, true, yes and on count. So a DEBUG value set for some other tool does not. Two helpers set the log file's path and how much it keeps.

Example code

bash
DEBUG=1 CLAUDE_CODE_DEBUG_LOG_LEVEL=verbose claude
Log everything for one session.

Common mistake

Setting only the logs folder and waiting for a file. The folder alone does not turn logging on.

Key takeaways

  1. 1
    1, true, yes, on. Turn it on.
  2. 2
    File per session. In ~/.claude/debug.
  3. 3
    Level and path. Two helpers.