Preheat your oven to 350°F (175°C) and line a baking sheet with parchment paper.
In a medium bowl, whisk together the flour, baking soda, and salt. Set aside.
In a large mixing bowl, cream together the softened butter, brown sugar, and granulated sugar until light and fluffy, about 3-4 minutes.
Add the eggs one at a time, mixing well after each addition. Then, stir in the vanilla extract and ube halaya until fully combined.
Gradually add the dry ingredients to the wet mixture, mixing until just combined. Be careful not to overmix.
Fold in the chocolate chips and walnuts (if using) until evenly distributed.
Using a cookie scoop or tablespoon, drop rounded balls of dough onto the prepared baking sheet, spacing them about 2 inches apart.
Bake for 12-15 minutes, or until the edges are lightly golden but the centers are still soft.
Allow the cookies to cool on the baking sheet for 5 minutes before transferring them to a wire rack to cool completely.