[BUG] Bash tool silently drops stdout from node processes when script path is under ~/.claude/
Resolved 💬 2 comments Opened Apr 9, 2026 by kjendrzyca Closed May 23, 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?
Bash tool silently drops stdout from node processes when the script path resolves under ~/.claude/. The process exits 0, no errors on stderr - output is just gone.
This breaks custom skills that shell out to node scripts when ~/.claude/skills/ is a symlink to an external directory.
Repro
- Have a node script that makes HTTP requests and writes JSON to stdout (e.g. a task management CLI client).
- Place it under
~/.config/mytools/skills/myscript/scripts/client.mjs. - Symlink:
ln -s ~/.config/mytools/skills ~/.claude/skills - The skill's shell wrapper uses
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"which resolves to the logical (symlink) path under~/.claude/.
Via ~/.claude/ path - no output:
# From Claude Code Bash tool:
printf '%s' "some-input" | node ~/.claude/skills/myscript/scripts/client.mjs list
# Result: empty stdout, exit 0
Via resolved path - works:
# Same script, same node binary, same args:
printf '%s' "some-input" | node ~/.config/mytools/skills/myscript/scripts/client.mjs list
# Result: full JSON output
Key observations
- Files are identical (
diffreturns 0) - one is accessed through the symlink, the other directly - Same node binary, same stdin input, same arguments
.claude/path: empty stdout, empty stderr, exit 0- Resolved path: full JSON output, exit 0
- Basic commands (
echo, directnode -e 'console.log("test")') work fine regardless of path - The issue specifically affects node processes that load
.mjsscripts from under~/.claude/
Expected
Bash tool should capture stdout from node processes regardless of whether the script path passes through ~/.claude/.
Workaround
Change pwd to pwd -P in the shell wrapper so SCRIPT_DIR resolves to the physical path outside ~/.claude/:
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
Environment
- macOS (Darwin 24.6.0)
- Shell: zsh
- Node: v24.13.0 (via nvm)
~/.claude/skillsis a symlink to~/.config/opencode/skills
Related
- #14836 -
/skillscommand doesn't find skills in symlinked directories (same symlink setup, different symptom)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗