[BUG] debug mode is sensitive to the env var `DEBUG` which is a poor design choice
Open 💬 2 comments Opened Jun 24, 2026 by lonetwin
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The env var DEBUG is a popular name for application debugging and tends to be set in dev environments. IMO, dev tools relying on the same in released software is bad design.
I had reported something similar for the gh-cli tool and there is a lot more reasoning there.
What Should Happen?
Like the gh-cli folk, please do reconsider deprecating this in favour for a more specifically scoped env var name (eg: CC_DEBUG) or remove it completely since the cli already has a --debug option.
Error Messages/Logs
Steps to Reproduce
- Change into a repo for an app that uses
DEBUG=trueenv var to enable debugging the app. - export DEBUG=True and start the app
- launch
claude - claude will startup with debug enabled
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.187
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
https://github.com/user-attachments/assets/52dca25b-4c27-4d76-8626-db21e09f4089
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗