Nexus 5 failed recovery due to /data partition
I used this link to repair my /data directory:

http://forum.xda-developers.com/google-nexus-5/general/howto-repairing-corrupted-data-partition-t2577447

Fortunately I was able to boot into fastboot mode the usual way ( Volume down and power at the same time ) unfortunately TWRP kept looping after erring on the corrupted /data folder. I ended up replacing TWRP with "Philz Recovery Nexus 5" because it booted up normally. I then formatted the /data, /system, /cache directories. That fixed the /data directory error and corruption problem. I was able to load CM13 successfully after that. I had to use a OTG external USB drive to load Philz Recovery Nexus 5, CM13 and GApps. I hope this helps. I'm sticking with Philz Recovery Nexus 5. It fixed the problem!