[BUG] "(Bash completed with no output)" if CLAUDE_ENV_FILE's last line is commented out
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?
In settings.json, I have env.CLAUDE_ENV_FILE set to my .zprofile file so that Claude Code Desktop inherits my PATH the same as Claude Code CLI. This works UNLESS the last line in my .zprofile is commented out with an initial "#" character. Comments elsewhere in the file don't matter, only in the last non-blank line will break it.
What Should Happen?
An "echo 'foo'" should show "foo", not "(Bash completed with no output)"
Error Messages/Logs
Steps to Reproduce
- Set env.CLAUDE_ENV_FILE in ~/.claude/settings.json to be "/Users/username/.zprofile"
- Make the last line of that file be: "# Claude bug"
- Run Claude Code Desktop
- Ask Claude to run the bash command "echo 'foo'"
- Observe "(Bash completed with no output)"
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.2278.0
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
First characterized it in 1.1062.0.
#19663 and #40977 look similar and might be the same root cause, but this is a very simple way to reproduce and track down the bug, as my setup is dead simple and works perfectly if I just get rid of the last line's comment. I'm on MacOS Sequoia 15.7.4 on x86, but have also reproduced it on an Apple Silicon Macbook Pro (also on Sequoia 15.7.4).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗