Bash tool ignores PATH from all config sources (settings.json env, .zshenv, .zprofile)

Resolved 💬 4 comments Opened Apr 5, 2026 by gg-d41 Closed May 19, 2026

Description

The Bash tool always runs with a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin), ignoring all user PATH configuration. This means common tools like uv, flutter, docker, etc. are not found.

Environment

  • macOS (Darwin 25.3.0, Apple Silicon)
  • Shell: zsh 5.9 (/bin/zsh)
  • Claude Code: latest version (reinstalled from website installer on 2026-04-05)

What I tried (none worked)

  1. env.PATH in ~/.claude/settings.json — no effect
  2. env.PATH in ~/.claude/settings.local.json — no effect
  3. ~/.zshenv with PATH exports — not sourced (this file should be read by every zsh invocation, including non-interactive)
  4. ~/.zprofile with PATH exports — not sourced
  5. /etc/paths.d/ entries (e.g. homebrew) — not picked up
  6. Full reinstall of Claude Code + laptop reboot — no change

Evidence

The Bash tool confirms it's running zsh 5.9, but startup files are not being sourced:

$ echo "PATH=$PATH"
PATH=/usr/bin:/bin:/usr/sbin:/sbin

$ echo "ZSH_VERSION=$ZSH_VERSION"
ZSH_VERSION=5.9

Manually sourcing works fine:

$ source ~/.zshenv && echo "$PATH"
/Users/me/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/me/flutter/bin

Expected behavior

At minimum, one of these should work:

  • env.PATH in settings.json should override the Bash tool's PATH
  • ~/.zshenv should be sourced (it's the zsh file specifically designed for non-interactive shells)

Workaround

Prefixing every command with source ~/.zshenv && works but is fragile and shouldn't be necessary.

View original on GitHub ↗

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