Improved stability and smart-material functionality realized in an energetic cocrystal.