You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unintended Debug Logging Triggered by .env File #346
Bug Description
If a .env file in the location where you run claude contains "DEBUG=true" then it causes Anthropic HTTP requests to be visible with debug information. That behavior is not desired.
Environment Info
Platform: linux
Terminal: konsole
Version: 0.2.31
Feedback ID: 819d6c2b-c9cc-40c2-90c5-931ed7ce0d15
I understand there is a .claudeignore or claude config add ignorePatterns .env but this prevents that data from being loaded into Claude, not prevent the CLI from reading it.
If possible, perhaps Claude's dotenv should not load the DEBUG variable and instead defer that to a command-line argument if it is desired.
Seeing this in Claude Code v0.2.79: same issue as reported above, have an .env file with DEBUG=true in the same working directory where Claude Code is running.
Can confirm the issue goes away if the .env file does not contain DEBUG=true.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
ashwin-ant commentedon Mar 5, 2025
This is a behavior of our SDK: https://github.com/anthropics/anthropic-sdk-typescript?tab=readme-ov-file#logging-and-middleware. We'll see what we can do here to suppress this.
richbradshaw commentedon Mar 12, 2025
Confirming that this is really annoying - I have multiple projects that have a .env with DEBUG=true - so this is a real pita!
wolffiex commentedon Mar 25, 2025
Sorry about this. We shouldn't be touching that file. Should be fixed in 0.2.54
luis-alvarado commentedon Apr 23, 2025
Seeing this in Claude Code v0.2.79: same issue as reported above, have an .env file with DEBUG=true in the same working directory where Claude Code is running.
Can confirm the issue goes away if the .env file does not contain DEBUG=true.
github-actions commentedon Aug 9, 2025
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.