Nexus 6

Issue: Device shuts down when battery level is low (0-40%), a distinct noise from the speaker might be present just before shutdown
Solution confirmed by author:

This issue is not very well documented but is battery related. A battery replacement can fix that issue if replacement battery is in good shape.

Unconfirmed but possible solutions:

Some suggest unplugging and plugging back the battery connector or holding the power button pressed for at least 30 seconds to attepmt a deeper reboot\

Disassembly:

 * Under the plastic back of the phone, above power/volume buttons, there is a flex cable which can easliy be torn while sliding in, proceed carefully.
 * Some screws might be hard to unscrew, be aware not to damage them, a simple repair might turn into a nightmare if you're not careful. Sometimes pinching the phone near to the screw helps to release tension and ease the unscrewing

Software:

 * Optimisation - battery life
 * Consider installing and configuring a custom kernel - undervolting, using a more battery friendly CPU governor and hotplug will result in much better battery life and possibly responsivness
 * If available, use alternative lightweight applications
 * Try not to use aplications that frequently wake up the phone from deep sleep, this can make a huge difference
 * Optimisation - performance
 * Consider using a custom kernel - overclocking and specific kernel options might give you a bit more performance.
 * New features
 * Consider installing a newer, unofficial android version. Many custom systems exist, most of them have many improvements over the stock experience.  You can find them on the XDA Nexus 6 forum.