Heat the olive oil in a large pan and add the grated courgettes, garlic, lemon zest, rosemary and chilli flakes.
Cook gently over a medium-low heat for 20-25 minutes until the courgettes are very soft.
Stir in the mascarpone and two-thirds of the cheese, then taste and season with salt and plenty of pepper
Cook the spaghetti in salted boiling water according to the packet instructions. Drain, add the pasta to the courgette sauce and stir well to combine.
Serve topped with the remaining grated cheese and freshly ground black pepper.