Bring a large pot of salted water to boil (3-4 quarts water, 1 tablespoon salt). Add pasta and cook according to the package instructions. Reserve about 1 cup pasta water, then drain and set aside.
Meanwhile, in a medium bowl, whisk the egg, then stir in the yogurt, parmesan, and salt until combined.
Once you’ve drained the pasta, wipe the pasta pot dry (or you can do this in a separate skillet), and add the oil, basil or oregano, black pepper (if using), and garlic. Turn the heat on low and cook until very fragrant and the garlic is softened, about 2 minutes (careful not to burn the garlic, it will continue to cook a bit in the oil before you add the pasta). Turn off the heat.
Add the pasta back to the pot and immediately stir to coat in that garlic oil. Add the yogurt mixture and stir until everything is well coated. You can thin the sauce out a bit with some of that reserved pasta water, if needed (this comes in handy if the pot is sitting out for a bit before serving).
Serve topped with black pepper and some fresh herbs if you have them.