This study used cell-specific recording and optogenetic manipulation in mice to show that distinct populations of nucleus accumbens D1 and D2 neurons play complementary roles in encoding and promoting different aspects of hedonic eating ('liking' and 'wanting').