In a microwave-safe bowl, melt the chocolate chips and butter together in 20-second intervals, stirring each time until smooth. Stir in espresso powder if using. Refrigerate the mixture for 15–20 minutes until thickened enough to scoop.
In a large bowl, cream together the softened butter, granulated sugar, and brown sugar until light and fluffy. Add the eggs and vanilla, mixing well.
In a separate bowl, whisk together flour, baking soda, and salt. Gradually mix the dry ingredients into the wet ingredients until a dough forms.
Cover and refrigerate the cookie dough for 30 minutes. This step helps the dough hold its shape during baking and makes it easier to handle.
Preheat your oven to 350°F (175°C). Line a baking sheet with parchment paper.
Scoop out a tablespoon of cookie dough and flatten it slightly. Add a small dollop of the chilled chocolate filling in the center. Top with another flattened tablespoon of dough and seal the edges well to enclose the filling. Roll gently into a ball.
Place the filled dough balls 2 inches apart on the prepared baking sheet. Bake for 9–11 minutes or until the edges are golden and the centers are just set. Let cool on the baking sheet for 5 minutes, then transfer to a wire rack to cool fully—or enjoy slightly warm for the gooey center!