Cook spaghetti according to package directions. Reserve about 1 cup of pasta water before draining.
While pasta is cooking, melt butter in a large skillet over medium heat. Add minced garlic and red pepper flakes (if using) and cook until fragrant, about 1 minute, being careful not to burn the garlic.
Add shrimp to the skillet and season with salt and pepper. Cook for 2-3 minutes per side, until pink and cooked through.
Pour in chicken broth and heavy cream. Bring to a simmer and cook for 2-3 minutes, allowing the sauce to thicken slightly.
Stir in grated Parmesan cheese until melted and the sauce is smooth.
Add the drained spaghetti and chopped fresh parsley to the skillet. Toss to coat the pasta and shrimp in the sauce. If the sauce is too thick, add a little of the reserved pasta water until it reaches your desired consistency.
Season with additional salt and pepper to taste. Serve immediately.
Notes
This garlic butter shrimp pasta is best served fresh. You can add a squeeze of lemon juice at the end for extra brightness.