Add flour to a large bowl. Using a pastry blender or fork, cut in cold butter until you have pea sized pieces.
Dissolve sugar and salt in 4 tbsp of the ice cold water. Add to the flour & butter and knead by hand just until the flour is incorporated and dough can be pushed into a ball. Add additional water half a tbsp at a time only if needed to bring the dough together. You should still see butter marbled through the dough.
Wrap dough in plastic wrap, flatten into a disk and chill in the refrigerator for at least 30 minutes, or up to a few days.
To make the filling, peel and chop the apples into small pieces. Add to a frying pan with remaining filling ingredients on low-medium heat. Cook until the liquid simmers and thickens to a caramel-like consistency, stirring occasionally. Set aside to cool to room temp.
Once the dough is chilled, roll it out on a lightly floured work surface into a 12"x12" square. While rolling, rotate the dough frequently to be sure it doesn't stick to the counter.
Use a ruler to mark 3"x3" squares and cut using a pizza cutter or sharp knife. Return squares to the fridge for about 10 minutes, until cold to the touch.
Preheat oven to 375°F. Prepare a baking tray with parchment paper. In a small bowl, whisk together the egg and salt until very well blended.
On half of the squares, make small cuts with a sharp knife. Be sure to cut all the way through to allow steam to escape. These will be the top crust.
On the other half of the squares, heap 2-3 tsp of the apple filling in the center. Lightly dab some of the egg wash around the border.
Place tops on each apple square. Using a fork, crimp all the way around the edges, pressing firmly to seal. Brush the tops with egg wash and sprinkle with sugar, if using. If the pies are not cool to the touch at this point, put them back in the fridge or freezer for a few minutes. They will hold their shape and be flakier if they go into the oven cold.
Place pies 2" apart on the baking tray and bake 25-30 minutes, until golden. Serve warm or room temperature.