Bring a large pot of generously salted water to a rolling boil. Add the spaghetti and cook until al dente according to package directions. Before draining, reserve 1 cup of the starchy pasta water, then drain the pasta.
While the pasta cooks, heat the olive oil in a large skillet over medium heat. Add the minced garlic and sauté until fragrant and just turning golden, about 1 minute. Do not let it burn.
Add the halved cherry tomatoes, salt, black pepper, and red pepper flakes (if using). Cook, stirring occasionally, until the tomatoes break down into a chunky, jammy sauce, about 12-15 minutes. If the sauce gets too dry, splash in a little pasta water.
Add the drained spaghetti to the skillet with the sauce. Toss vigorously with tongs until every strand is coated, adding splashes of reserved pasta water as needed to create a glossy, loose sauce that clings to the pasta.
Remove the skillet from the heat. Fold in the torn basil leaves. Divide among plates, top with a generous grating of Parmesan and extra basil, and serve immediately.