Bring a large pot of salted water to a boil. Cook the pasta according to package directions. Reserve 1/2 cup pasta water before draining.
Bring a small saucepan of water to a gentle boil. Lower in the eggs and cook exactly 6 minutes.
Whisk together the pesto and heavy cream until smooth.
Transfer the eggs to cold water to stop cooking. Peel once cool enough to handle.
Add the drained pasta to the pesto-cream mixture, tossing to coat. Add pasta water if needed, then stir in Parmesan and season.
Divide the pasta between two bowls. Halve each egg and place on top.
Finish with extra Parmesan, torn basil, and chili flakes if using. Serve immediately.