In a large bowl, whisk together the flour, baking soda, ginger, pepper, allspice, salt, and cloves. Set aside.
In a stand mixer fitted with the paddle attachment, beat the butter and brown sugar on medium speed until slightly pale, about 1 minute.
Add the eggs one at a time, beating thoroughly after each addition until fluffy, about 1 minute.
Add the molasses, vinegar, and vanilla and beat until combined.
Reduce the mixer speed to low and gradually add the flour mixture, beating just until the last trace of flour disappears. The dough will be very soft and sticky.
Divide the dough in half, wrap each half in plastic, and press into a 6 × 6-inch square.
Refrigerate the dough until firm, at least 1 hour and up to 2 days.
Arrange two oven racks in the upper and lower thirds of the oven and preheat to 350°F. Line two rimmed baking sheets with parchment paper.
Place the demerara sugar in a small bowl. Remove one square of dough from the fridge, portion into 1-ounce pieces, and roll each into a ball (they should be about 1¼ inches in diameter). Toss the balls in the demerara sugar to coat all over, then place on the prepared baking sheets, spaced about 3 inches apart (the cookies will spread during baking). Refrigerate any balls that don’t fit on the baking sheets.
Bake on the upper and lower racks until the edges are firm to the touch but the centers are still very soft and slightly shiny, 12 to 14 minutes, switching racks and rotating the sheets front to back halfway through.
Remove from the oven and cool for 15 minutes on the baking sheets before using a spatula to transfer them to a wire rack. Repeat the rolling and baking process with the remaining dough and demerara sugar. Recipe from Claire Saffitz.