Prep your oven and pans. Position a rack in the center of the oven and preheat the oven to 350°F. Lightly spray a 9 x 5-inch loaf pan with cooking spray and line with parchment paper, leaving a 2-inch overhang on the pan's two long sides. Spray the parchment, too.
Make the chocolate chip cookie dough. In a medium bowl, whisk together the flour, baking soda, and salt.
Melt the butter in a medium, heatproof bowl in 15- to 20-second intervals, using a heatproof rubber spatula to stir as needed. Pour the brown sugar over the melted butter and mix with a heatproof rubber spatula until just combined. When melted, add the egg yolk and vanilla and mix until just combined. Gradually mix in the dry ingredients and mix until just combined. Add the chocolate and mix until evenly distributed throughout.
Start assembling the brookie bars. Use a 1-Tablespoon cookie dough scoop to portion half of the cookie dough into balls, dropping each ball randomly into the prepared loaf pan as you go. Gently press down on each cookie dough ball. Reserve the other half of the cookie dough for the brookie bar topping.
Make the brownie batter. In a medium bowl, whisk together the granulated sugar, flour, cocoa powder, confectioners' sugar, and salt.
Melt the butter in a medium, heatproof bowl in 15- to 20-second intervals, using a heatproof rubber spatula to stir as needed. When melted, add the egg and vanilla and mix until just combined. Gradually mix in the dry ingredients and mix until just combined. Add the water and mix until just combined.
Finish assembling the brookie bars. Pour the batter into the prepared pan with the cookie dough and use an offset spatula to smooth the top, covering the cookie dough pieces. Sprinkle the top of the batter with generous pinches of the remaining chocolate chip cookie dough. Gently press down on the pieces to meld them into the brownie batter. Bake the brookie bars. Bake for 50 to 55 minutes, or until a skewer inserted into the center of the brownies comes out with a few crumbs attached. Check the bars around 30 minutes into the Bake Time—if the cookie dough is browning too quickly, cover the pan with a loose sheet of aluminum foil. Cool completely on a wire rack before slicing.
Serve and store. Run a butter knife or offset spatula along the edges of the pan and use the overhanging parchment as handles to lift the brookie bars out of the pan and onto a cutting board. Follow the instructions in the baker's notes to slice into 8 petite squares, or 2 large bakery-style bars. Garnish with flaky salt and serve. The brookie bars can be stored in an airtight container or zip-top bag at room temperature for up to 3 days.