Recently ran into this issue as well. My problem is that I want to apply the same piped commands to multiple files. I ended up getting away with a simple shell loop. In case helpful:
for file in $(<command_that_produces_list_of_files_of_interest>); do
grep " 287 " $file | grep HI | xargs sed -i 's/HIS/HID/g' ;
done