Stitch Fix Inc. shares rallied more than 20% in the extended session Tuesday after the online styling company posted a narrower-than-expected quarterly loss and unveiled a current-quarter guidance that was also better than hoped.