[BUG] "(Bash completed with no output)" if CLAUDE_ENV_FILE's last line is commented out

Resolved 💬 3 comments Opened Apr 13, 2026 by mattalbright Closed Apr 17, 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?

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

  1. Set env.CLAUDE_ENV_FILE in ~/.claude/settings.json to be "/Users/username/.zprofile"
  2. Make the last line of that file be: "# Claude bug"
  3. Run Claude Code Desktop
  4. Ask Claude to run the bash command "echo 'foo'"
  5. 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).

View original on GitHub ↗

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