環境変数
CLAUDE_CODE_DEBUG_LOGS_DIR
デバッグログの出力先ファイルパスを上書きします(変数名にDirとありますが、ディレクトリではなくファイルパスを指定します)。
使い方・用途
- デフォルトの保存先(
~/.claude/debug/)以外の特定の場所にログを収集・集約したい場合に使用します。 - この設定単体ではログ出力は有効化されず、
--debugなどのフラグと併用する必要があります。
英語原文(公式ドキュメントより)
Override the debug log file path. Despite the name, this is a file path, not a directory. Requires debug mode to be enabled separately via --debug or /debug: setting this variable alone does not enable logging. The --debug-file flag does both at once. Defaults to ~/.claude/debug/<session-id>.txt