Preheat oven to 375°F (190°C).
In a bowl, combine 1 cup all-purpose flour, 1/2 cup crushed nuts (pecans, if desired), 1/4 cup sugar, and 1/2 cup melted butter. Mix until evenly moistened.
Press the mixture firmly and evenly into the bottom of a 9x13-inch baking dish.
Bake the crust at 375°F for 10 minutes. Remove from oven and let the crust cool completely in the pan.
While the crust cools, place 20 KRAFT caramels (unwrapped) and 3 tablespoons heavy whipping cream in a small saucepan. Heat over low heat, stirring frequently, until the caramels melt and the mixture is smooth.
Pour the melted caramel evenly over the cooled crust. Refrigerate the pan until the caramel is set, about 15–30 minutes.
In a mixing bowl, beat 8 ounces softened cream cheese until light and fluffy. Gradually add 1 cup powdered sugar and beat until fully combined.
Fold 1 cup Cool Whip (from the 8-ounce container) into the sweetened cream cheese until evenly blended. Reserve the remaining Cool Whip from that container for the topping.
Spread the cream cheese mixture evenly over the set caramel layer.
In a separate bowl, whisk together the 6.8 ounces chocolate instant pudding (two 3.4-ounce packages) and 3 cups cold milk according to package directions, until the pudding thickens.
Spread the prepared chocolate pudding evenly over the cream cheese layer.
Top the pudding layer with the remaining Cool Whip from the 8-ounce container, spreading it evenly.
Sprinkle 1/4 cup chocolate shavings over the top. Refrigerate the dessert until fully chilled and set before serving (at least 1–2 hours).