Tip:It’s not just the sauce that needs seasoning. Tease out the nutty flavor of pasta by adding a couple of tablespoons of kosher salt to the cooking water. The water should taste salty, like the ocean.
Bring a large pot of well-salted water to a boil.
Heat the oil and garlic in a 10-inch straight-sided sauté pan over medium-low heat, stirring until the garlic becomes fragrant and starts to brown all over, 4 to 5 minutes. Add the red pepper flakes and rosemary, cook for 30 seconds, and then remove from the heat.
Cook the spaghetti in the boiling salted water, stirring occasionally, until it’s just tender to the tooth (see the package for cooking time). Reserve 1/2 cup of the pasta water and drain the pasta.
Return the sauté pan to medium heat and fish out and discard the garlic. Add the drained pasta and 1/4 cup of the reserved pasta water. Cook for 1 to 2 minutes, tossing and stirring, to blend the flavors. If the pasta isn’t tender, add the remainder of the cooking water and continue to cook and stir until done. Toss with half of the pecorino and 1/2 tsp. black pepper. Season with salt and more pepper to taste.
Serve immediately, sprinkled with the remaining pecorino and a few grinds of black pepper.