Set the graham crust on a baking sheet for easy moving.
Whisk sugar, cocoa, cornstarch, and salt in a medium saucepan.
Slowly whisk in cold milk until smooth with no dry spots.
Cook over medium heat, whisking often, until thick and bubbling, 5–7 minutes.
Temper the yolks: whisk 1 cup hot pudding into yolks, then whisk yolk mixture back into the pot.
Simmer 1–2 minutes more, whisking, until glossy and very thick.
Remove from heat. Stir in chocolate chips, butter, and vanilla until fully melted and smooth.
Let stand 5 minutes, then scrape pudding into the crust and smooth the top.
Press plastic wrap directly on the surface. Chill until set, about 4 hours or overnight.
Top with whipped cream and chocolate shavings. Slice and serve cold.