Slice the ham in tiny cubes and set aside; peel, wash and dry the garlic cloves; wash the parsley and the basil, dry delicately with a clean tea towel, chop finely and separately with a very sharp knife. Clean the mushrooms removing the hard and muddy part, wash them quickly in cold water, once drained and dried with a tea towel slice them finely into segments.Put 3 tbsp of oil in a saucepan with a clove of garlic and the red chilli and fry until soft not golden. Add the ham cubes and brown them lightly stirring with a wooden spoon. Add the tomatoes, a pinch of chopped parsley and basil, season with salt and cook over a medium heat, for 15 minutes, tossing the sauce from time to time with a wooden spoon. In the meanwhile pour the remaining oil in another pan, add the slightly crushed clove of garlic and fry lightly until soft; add the mushrooms, season with a pinch of salt and pepper and brown for 2-3 minutes over a high heat; sprinkle the remaining parsley add them to the tomato sauce and flavour for a few minutes.Cook the pasta in a saucepan with plenty of boiling salted water; drain it al dente and mix it to the sauce, a last sprinkle of chopped basil and pecorino cheese and serve warm.