Command reference
Writes debug logs to a file path you choose, and turns on debug mode along the way.
FlagsDiagnosiscurrent
It takes precedence over CLAUDE_CODE_DEBUG_LOGS_DIR. Useful when the output you need to read is the same output that is scrolling your session away.