Line two large baking sheets with parchment or wax paper. Measure and stage the peanut butter, vanilla, oats, and salt before starting.
Combine sugar, butter, milk, and cocoa powder in a medium saucepan over medium heat. Stir continuously until butter melts and mixture is smooth. Bring to a full rolling boil — the entire surface covered in active bubbles. Set a timer for exactly 1 minute and boil, stirring occasionally.
Remove from heat immediately. Stir in peanut butter and vanilla until completely smooth and glossy.
Add oats and salt. Stir quickly until all oats are coated.
Drop heaping tablespoons onto parchment paper. Flatten each mound slightly with the back of a spoon. Sprinkle with flaky salt if using.
Let cool at room temperature for 20–30 minutes until completely firm. Do NOT refrigerate while still warm.