Preheat and prep: Heat your oven to 375°F (190°C). Lightly grease a 9x13-inch baking dish.
Pat chicken dry and season generously with salt and pepper.
Sear the chicken: Heat 1 tablespoon oil in a large skillet over medium-high. Add chicken in a single layer and sear 2–3 minutes per side until lightly golden. It doesn’t need to be fully cooked.
Transfer to the baking dish.
Sauté aromatics: In the same skillet, add remaining oil and the butter. Add onion (if using) and cook 2–3 minutes until soft. Stir in garlic and cook 30 seconds until fragrant.
Cook the mushrooms: Add sliced mushrooms, a pinch of salt, and cook 5–7 minutes, stirring occasionally, until browned and most moisture has evaporated.
Build the sauce: Lower heat to medium.
Stir in cream cheese until melted and smooth. Add heavy cream, chicken broth, and pesto. Simmer 2–3 minutes, stirring, until slightly thickened.
Season with salt, pepper, and a pinch of red pepper flakes. Add lemon juice if you like a brighter note.
Combine: Pour the mushroom pesto cream sauce over the chicken in the baking dish. Gently toss to coat and spread evenly.
Top with cheese: Sprinkle mozzarella (or provolone) over the top.
Finish with grated Parmesan for extra depth.
Bake: Bake uncovered for 18–22 minutes, until the cheese is melted and bubbly and the chicken reaches 165°F (74°C).
Brown the top (optional): Broil 1–2 minutes for golden, blistered cheese. Watch closely.
Rest and serve: Let the casserole rest 5 minutes to set. Garnish with chopped basil or parsley.
Serve as is or with a simple side.