[BUG] debug mode is sensitive to the env var DEBUG which is too generic and very likely to be declared for the codebase claude-code is used for

Status Open
Reported on v2.1.276
Maintainer reply None cached
Activity 2 comments · opened Sep 18, 2026

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 a specific value (eg: DEBUG=cc-debug) or remove it completely since the cli already has a --debug option.

Error Messages/Logs

Steps to Reproduce

  1. Change into a repo for an app that uses DEBUG=true env var to enable debugging the app.
  2. export DEBUG=True and start the app
  3. launch claude
  4. 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.276

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 has been reported multiple times:

  1. https://github.com/anthropics/claude-code/issues/346
  2. https://github.com/anthropics/claude-code/issues/11015
  3. https://github.com/anthropics/claude-code/issues/24
  4. https://github.com/anthropics/claude-code/issues/70576

But every time the report has been closed without an actual resolution.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗