Heat the olive oil in a large saucepan over medium heat.
Add the garlic cloves and rosemary, allowing them to infuse the oil for 2–3 minutes.
Add the chickpeas and stir well.
Mash about one-third of the chickpeas with a fork or immersion blender and return them to the pot. This creates the traditional creamy texture.
Pour in the broth or water and simmer gently for 15 minutes.
Remove the rosemary sprig and garlic cloves if desired.
Add the pasta directly to the pot and cook, stirring frequently.
Add additional hot water if necessary. The final consistency should be thick and creamy, not soupy.
Season with salt, black pepper, and chili flakes if using.
Let rest for a couple of minutes before serving.