"Error: write EPIPE" error During Bash Command Execution

Resolved 💬 16 comments Opened Jul 18, 2025 by DrBenedictPorkins Closed Jul 19, 2025
💡 Likely answer: A maintainer (wolffiex, collaborator) responded on this thread — see the highlighted reply below.

Bug Description

Experiencing consistent ClaudeCode PIPE errors resulting in crashes when running bash commands.
A simple Bash(ls -la) or Bash(date) execution causes the issue.

node:events:497
throw er; // Unhandled 'error' event
^

Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:95:16)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 1.0.55
  • Feedback ID: 11c8f576-9b00-454d-9156-ba30e22bf60f

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:984:15)\n    at wrappedFn (node:internal/errors:538:14)\n    at checkExecSyncError (node:child_process:891:11)\n    at execSync (node:child_process:963:15)\n    at q5 (file:///Users/X/node_modules/@anthropic-ai/claude-code/cli.js:727:4693)\n    at file:///Users/X/node_modules/@anthropic-ai/claude-code/cli.js:640:41282\n    at Q (file:///Users/X/node_modules/@anthropic-ai/claude-code/cli.js:542:14406)\n    at PF (file:///Users/X/node_modules/@anthropic-ai/claude-code/cli.js:640:39067)\n    at $X (file:///Users/X/node_modules/@anthropic-ai/claude-code/cli.js:640:37933)\n    at RB (file:///Users/X/node_modules/@anthropic-ai/claude-code/cli.js:640:43902)","timestamp":"2025-07-18T01:19:12.442Z"}]

View original on GitHub ↗

16 Comments

labrute974 · 12 months ago

Experiencing the same issue when Claude Code (1.0.55) tries to run the Bash command git status

⏺ I'll analyze the current changes and create an appropriate conventional commit.

  Bash(git status)
  ⎿  Running…

  Bash(git diff)
  ⎿  Running…

  Bash(git diff --cached)
  ⎿  Running…

  Bash(git log --oneline -5)
  ⎿  Running…

✽ Noodling… (7s · ⚒ 90 tokens · esc to interrupt)
  ? for shortcuts


node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v22.12.0
whoisdjrico · 12 months ago

Same here (running 1.0.55):

node:events:492
throw er; // Unhandled 'error' event
^

Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}

Node.js v20.10.0

kratsg · 12 months ago
leocape · 12 months ago
node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v22.17.0

Doctor:

Claude CLI Diagnostic
 Currently running: npm-global (1.0.55)
 Path: .../.nvm/versions/node/v22.17.0/bin/node
 Invoked: .../.nvm/versions/node/v22.17.0/bin/claude
 Config install method: local
 Auto-updates enabled: true
 Update permissions: Yes

wolffiex collaborator · 12 months ago

Thanks for this report everyone. We are going to roll back our stable pointer to 1.0.53 while we debug. 1.0.54 has fixes for problems with shell snapshots being deleted but causes people with large environments.

wolffiex collaborator · 12 months ago

Does anyone have an example .bashrc or .zshrc that repros this issue?

leocape · 12 months ago
Does anyone have an example .bashrc or .zshrc that repros this issue?

@wolffiex this is on an Ubuntu 22.04 VM running on MacOS 15.5 (reverting to 1.0.54 did resolve the issue)

cat ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color|*-256color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
	# We have color support; assume it's compliant with Ecma-48
	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
	# a case would tend to support setf rather than setaf.)
	color_prompt=yes
    else
	color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

and on the Macbook:

cat ~/.bashrc

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
. "$HOME/.cargo/env"

# bun
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH

# go
export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin

export PATH="$PATH:$HOME/.rvm/bin"

and .bash_profile (messy!):

cat ~/.bash_profile
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export PATH=$PATH:~/Library/Android/sdk/platform-tools
export ANDROID_HOME=~/Library/Android/sdk
export PATH="$HOME/.bin:$PATH"
export PATH="~/Library/Android/sdk/platform-tools":$PATH
export PATH="$PATH:/Applications/Docker.app/Contents/Resources/bin/"
export BASH_SILENCE_DEPRECATION_WARNING=1
export DOCKER_DEFAULT_PLATFORM=linux/amd64
PATH="/opt/homebrew/bin:$PATH"
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
. "$HOME/.cargo/env"

export PATH=$PATH:~/go/bin
export PATH=$PATH:$HOME/Library/Android/sdk/emulator

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/leo/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/leo/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/leo/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/leo/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/leo/exec -l /bin/bash/google-cloud-sdk/path.bash.inc' ]; then . '/Users/leo/exec -l /bin/bash/google-cloud-sdk/path.bash.inc'; fi

# The next line enables shell command completion for gcloud.
if [ -f '/Users/leo/exec -l /bin/bash/google-cloud-sdk/completion.bash.inc' ]; then . '/Users/leo/exec -l /bin/bash/google-cloud-sdk/completion.bash.inc'; fi
wolffiex collaborator · 12 months ago

@leocape on the mac, can you run claude -d ?
this'll print out a path where we save the snapshot script. the contents of the snapshot script would be immensely helpful with the debugging

leocape · 12 months ago
nhuerta · 12 months ago

Thanks @wolffiex for looking into it. Since I am on v1.0.54 now, not sure if the output of claude -d would help so much and I can't roll forward to v1.0.55 right now. Aside from upgrading the version, I gave some specific instructions about parallelism that I thought was the main culprit. But rolling back to v.1.0.54 worked fine. It fails fairly quickly with local environment commands so my intuition indicates a synchronization issue where there might be a missing await for OS level commands or something along those lines. Hope this helps and feel free to ask for more information. Thanks again!

kennethdreyer · 12 months ago

This sucks. Haven't been able to use claude code all day! No bash commands, no subagents, can configure anything via Claude...

wolffiex collaborator · 12 months ago

if you reinstall claude or do claude update you will get a version that doesn't have this issue

nhuerta · 12 months ago

Current version: 1.0.53
Checking for updates...
Claude Code is up to date (1.0.53)

helpimfalling · 12 months ago
if you reinstall claude or do claude update you will get a version that doesn't have this issue

Fixed it for me thx

wolffiex collaborator · 12 months ago

thanks for everyone's patience here. we have a new build. if anyone wants to help verify it, please do npm i -g @anthropic-ai/claude-code@1.0.56 and report back

github-actions[bot] · 11 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.