Wash the cassava leaves, remove tough stems and veins, then finely chop them or pulse briefly in a food processor; set aside.
In a dry pan over medium heat, roast the peanuts until golden brown and aromatic; cool completely, then grind in a food processor or mortar and pestle until they reach a paste-like but slightly coarse texture.
Heat the cooking oil in a large skillet or saucepan over medium heat and sauté the chopped onion until softened, about 3–5 minutes.
Add the shrimp to the pan and cook gently for 2–3 minutes until they begin to turn opaque.
Pour in the coconut milk, add the minced garlic and crushed red pepper, then bring the mixture to a gentle simmer for a couple of minutes.
Stir the ground peanuts into the simmering mixture until they dissolve and thicken the sauce evenly.
Add the chopped cassava leaves and mix thoroughly so they are well coated with the sauce.
Reduce heat to low and simmer, uncovered, for about 60–90 minutes, stirring often, until the cassava leaves are fully cooked, the sauce has thickened, and flavors have blended; season with salt to taste.
Serve the matapa hot with boiled rice or xima (maize meal).