Pour 2 tablespoons of olive oil into a large skillet and cook the mushrooms, stirring occasionally, until golden brown, about 8 minutes. Add shallot and garlic and cook, stirring occasionally, until shallot is softened, about 3 minutes more; season with salt. Transfer mushroom mixture to a medium bowl.
In same skillet over medium-high heat, pour the remaining 2 tablespoons of oil. Add pasta in an even layer and cook, undisturbed, until golden brown on the bottom, about 5 minutes. Stir and continue to cook, stirring occasionally, until pasta is cooked through, about 2 minutes more. Add butter and return mushrooms to skillet. Cook, stirring, until butter is melted, about 2 minutes. Stir in red pepper flakes; season with salt.