Prep: Preheat the oven to 300 F and set a 9×13 baking dish (preferably one with a lid) aside. Rinse the tomatoes well and pat dry with a clean kitchen towel. Trim the ends off of the garlic cloves, then lightly smash them with the flat edge of a knife; remove and discard the papery skins.: The air in the kitchen fills with a warm, anticipatory scent as you preheat the oven to 300 F . You will notice the heat feels steady but not aggressive, which is what we want to coax sweet flavor without bursting the tomatoes into a burnt mess. Rinsing the cherry tomatoes and patting them dry removes surface moisture that would otherwise stew rather than roast, and trimming the garlic and lightly smashing the cloves helps release aroma into the oil while keeping the clove intact. One common mistake is rushing this step and loading wet tomatoes into the dish, which makes the oil cool and delays proper softening. Keep the tomatoes mostly dry and give the garlic just enough bruise to bloom, not to purée it.
Combine: Add the tomatoes and garlic to the base of the baking dish. Nestle the herbs in with the tomatoes, then sprinkle with red pepper flakes (if using) and salt. Pour the oil on top and use a spatula to mix well, until all of the tomatoes are coated in oil.: When you add the cherry tomatoes and whole garlic to the baking dish, the scene becomes colorful and promising, with reds and whites nestled together. Nestle the fresh herbs among the tomatoes so their leaves steam and infuse rather than burn on top. Sprinkling the optional red pepper flakes and kosher salt now allows them to distribute evenly as oil is poured. Pouring the olive oil over everything creates a glossy coating, and using a spatula to mix ensures every tomato is kissed by oil which promotes even heat transfer. A common error is skimping on the oil which leads to uneven cooking and drier tomatoes; be generous so the oil both cooks and preserves.
Roast: Cover the baking dish with a lid, or wrap tightly with aluminum foil. Bake in the middle rack of the oven for 30 minutes, then uncover and give everything a good stir. Cover the dish and return to the oven for an additional 30 minutes.: Covering the dish traps gentle steam and starts the breakdown of tomato flesh, which you can sense as the kitchen warms with a sweet tomato aroma. Baking on the middle rack for 30 minutes allows internal softening without excessive browning, and when you uncover and stir you will see some oil pooling and skins loosening. After stirring and re-covering, returning the dish to the oven continues the slow melt, creating a silky mouthfeel. Avoid using too high a temperature at this stage because the tomatoes could split and dry rather than develop sweetness; slow, steady heat is the goal.
Caramelize: Uncover the dish; at this point the tomatoes should have deflated and the garlic should look more translucent. Return the baking dish to the middle rack of the oven and increase the temperature to 325 F. Bake uncovered for an additional 15 to 30 minutes, depending on how caramelized you like your tomatoes and garlic. Check on the tomato confit every 10 minutes or so to ensure it does not burn.: As you uncover the dish again and increase the oven to 325 F , the tempo changes and caramel notes begin to form. The tomatoes flatten slightly and the garlic turns translucent and then golden, releasing a roasted perfume that makes the whole kitchen hum. Bake uncovered for an additional 15 to 30 minutes depending on how deep you want the caramelization; check every ten minutes to watch for browning at the edges. You should listen for a quiet sizzle and watch for oil to gently shimmer. A frequent mistake is leaving the oven temperature too low which prolongs the process and can yield less pronounced caramelization; conversely, too high heat will char and create bitter edges.
Serve & Store: Let cool in the baking dish for at least 10 minutes, then carefully transfer to a glass jar or another airtight storage container. Enjoy immediately, or store in the airtight container in the refrigerator for up to 2 weeks. Make sure all tomatoes and garlic are submerged in oil so they do not mold.: Cooling the dish for at least 10 minutes lets flavors settle so you can transfer safely to jars, and the aroma at this point will be rich, sweet, and herb scented. When you spoon the confit into a glass jar, make sure the tomatoes and garlic are submerged in the olive oil so they stay preserved and avoid surface mold. A troubleshooting tip is to press a piece of parchment over the top before sealing to ensure full oil coverage, especially if your jar opening is narrow. I store mine in the refrigerator for up to two weeks, and usually pull jars out to stud pastas, finish grilled vegetables, or spoon over warm bread for immediate enjoyment.