With a sharp knife, mince together the basil, garlic, and hot pepper flakes with the coarse salt and set aside (Alternatively, mash together with a mortar and pestle)
In a large skillet or dutch oven heat the olive oil over medium high heat. Add the onion and saute until soft and lightly caramelized, about 6 minutes. Add the garlic-herb mix and cook an additional 2 minutes. Add the tomatoes and the remaining 6 ingredients through the pepper and simmer until the sauce is thickened and slightly reduced (about 15 - 20 minutes). This can simmer while baking the spaghetti squash (or cooking the pasta).
Bake the spaghetti squash in the oven for about an hour at 375 F. (Or cook the pasta in rapidly boiling water, stirring often, until there is no raw flour taste (about 7-10 minutes for penne). Using a fork, remove the strands of squash (or drain the pasta if using pasta)
Put the spaghetti squash strands (or the drained pasta) in a large pot and place over medium heat. Spoon most of the Puttanesca sauce into the pot and cook a few minutes, or until the liquid is absorbed.
Taste for seasoning, and garnish with some chopped basil and grated parmesan or romano cheese and serve. Place small bowls of extra sauce, and extra cheese to pass around for individual tastes.