Environment
- Platform (select one):
- Claude CLI version: 0.2.35 (Claude Code)
- Operating System: macOS 15.3.1
- Terminal: Warp
Bug Description
For the life of me I couldn't figure out why Claude running my Laravel test suite was dropping my local development database every time. During testing, it should rather be using the test environment database for running migrations.
Then after a lot of digging I realized asking Claude to dump its env, it had loaded my projects .env file into its bash env. This causes Laravel to completely ignore whatever I have written in my .env file or any phpunit.xml.
Is it just me or does this seem like a massive issue? Big fan of Claude here and been using the CLI a ton. But I was under the impression that it was quite transparent in what It was doing, but somehow loading my .env wasn't on the list of things I was expecting 🤔
Steps to Reproduce
- Create an empty folder and create a
.env file with the contents 'MY_SECRET_ENV=test'
- Open terminal, navigate to the folder and run
claude
- Ask Claude to
run env. Now you should see 'MY_SECRET_ENV=test ' listed in the output. This will not happen when you just type env in your own bash terminal.
Expected Behavior
Claude should not load my projects .env in its bash environment
Actual Behavior
See above.
Environment
Bug Description
For the life of me I couldn't figure out why Claude running my Laravel test suite was dropping my local development database every time. During testing, it should rather be using the test environment database for running migrations.
Then after a lot of digging I realized asking Claude to dump its
env, it had loaded my projects.envfile into its bash env. This causes Laravel to completely ignore whatever I have written in my .env file or any phpunit.xml.Is it just me or does this seem like a massive issue? Big fan of Claude here and been using the CLI a ton. But I was under the impression that it was quite transparent in what It was doing, but somehow loading my .env wasn't on the list of things I was expecting 🤔
Steps to Reproduce
.envfile with the contents 'MY_SECRET_ENV=test'clauderun env. Now you should see 'MY_SECRET_ENV=test ' listed in the output. This will not happen when you just typeenvin your own bash terminal.Expected Behavior
Claude should not load my projects .env in its bash environment
Actual Behavior
See above.