Preheat oven to 375 degrees. Line two baking sheets with parchment paper.
In a medium bowl, whisk together flour, cocoa, baking soda and salt: set aside.
In a large bowl, using a hand or stand mixer fitted with a paddle, beat together butter, granulated sugar and brown sugar until light and fluffy. Add eggs and vanilla, beat to combine. Gradually add flour mixture to butter mixture and beat just until combined. Stir in chocolate chips and walnuts, if using.
For cookies: Drop dough by tablespoonfuls onto prepared baking sheets. Gently press 3 white chocolate chips into each cookie and bake about 9-10 minutes (Do not over-bake). Cool on a baking rack.
For bars: Pat dough into a greased 9x13-inch baking pan and bake for 20 to 25 minutes. Cut into squares when cooled.