Stir sugar, milk, butter, and cocoa powder together in a saucepan over medium heat; bring to a boil and cook, stirring constantly, to dissolve sugar completely, 90 seconds to 2 minutes. Remove saucepan immediately from heat.
Stir peanut butter and vanilla extract into the milk mixture until smooth; add oats and stir to coat. Spoon the mixture onto a sheet of baking parchment and let sit until the mixture holds together, about 15 minutes.