Boil pasta in salted water until al dente. Reserve ½ cup pasta water and drain.
Heat olive oil in a pan over medium heat. Add garlic and cook briefly until fragrant.
Add cherry tomatoes and cook until they soften and begin to burst. Stir occasionally.
Season with salt and black pepper. Add chili flakes if using.
Add cooked pasta to the pan and mix well.
Pour in a little reserved pasta water and toss until the sauce coats the pasta smoothly.
Finish with fresh basil, optional cheese, or a squeeze of lemon juice. Serve warm.