Heat the oven to 350°F (175°C) and line the pan with parchment. The paper should hang over the sides so the bars are easy to lift later.
Melt the butter for the brownie layer until just liquid. Stir in sugar, then eggs, until smooth and shiny. The batter should look thick.
Mix in the cocoa powder or melted chocolate. Add flour and stir just until combined. Fold in chocolate chips. The batter will be dark and dense.
Spread the brownie batter evenly in the pan. Use the back of a spoon to smooth it out.
In a clean bowl, mix butter and sugar for the cookie layer until smooth. Stir in the egg. Add flour and mix until a soft dough forms. Fold in chocolate chips.
Drop spoonfuls of cookie dough over the brownie batter. Press them down lightly, leaving uneven patches. The top should look rustic, not smooth.
Sprinkle extra chocolate chips and flaky salt on top if using.
Bake for 25–35 minutes. The top should look set and lightly golden. The center should still feel soft.
Let the pan cool completely. Lift out the slab and cut into squares.