12 ounces spaghetti
3 large beefsteak tomatoes (about 1 1/2 pounds), each cut into 4 thick slices
3 tablespoons olive oil, plus more for the baking sheet
kosher salt and black pepper
8 ounces fresh mozzarella, grated
1/4 cup grated Parmesan (1 ounce), plus more, shaved, for serving
2 cloves garlic, chopped
1/4 to 1/2 teaspoon crushed red pepper
3/4 cup sliced fresh basil leaves, plus more for serving
Heat broiler. Cook the pasta according to the package directions; drain and return it to the pot.
Meanwhile, arrange the tomato slices in a single layer on a lightly oiled rimmed baking sheet. Season with 1/4 teaspoon each salt and black pepper. Dividing evenly, sprinkle the slices with the mozzarella and Parmesan. Broil until the cheese is bubbly and golden, 3 to 5 minutes.
Warm the oil with the garlic and red pepper in a small saucepan over medium heat until fragrant, 1 to 2 minutes.
Add the garlic oil, basil, 1/2 teaspoon salt, and 1/4 teaspoon black pepper to the pasta and toss to combine. Serve topped with the tomatoes, additional basil, and shaved Parmesan.