Cut the zucchini into small cubes.
Put the garlic to brown with the olive oil in a non-stick pan over medium heat.
Put the water for the pasta on the fire and when it boils cook the pasta following the package instructions.
When the garlic is brown, add the zucchini and let them brown. Add a pinch of salt and stir often. You don't want to burn them but you want them brown, so don't add water.
In the meantime, if you are using canned cannellini beans, drain them and wash them properly.
When the zucchini are brown, remove them from the pan and set them aside.
Heat up the remaining oil in a pan with the garlic. You can use the same garlic you used for the zucchini. When hot, add the cannellini beans and a pinch of salt and sautée them for a minute.
If you are using it, add the chili flakes and the oregano to taste and the tomato sauce and keep stirring.
When the cannellini beans are fully mixed and combined, blend a part of it. To make it more creamy, add a spoon or two of the cooking water of the pasta. Depending on how you want to serve the pasta, you can blend the beans directly into the pan or by placing a part of them in a separate bowl.
Once the pasta is cooked, drain it and add it to the pan with the beans. Mix well, add the zucchini, and serve warm with a sprinkle of parmesan or gomasio.