Step 1 (Boil Spaghetti): Bring a large pot of salted water to a boil. Cook the spaghetti according to package instructions until al dente. Reserve ½ cup of starchy pasta water, then drain the spaghetti and set aside.
Step 2 (Heat Oil & Sauté Onion): Heat the olive oil in a large skillet over medium heat. Add the finely chopped onion and sauté until soft and translucent, about 3–4 minutes.
Step 3 (Bloom Garlic & Chili Flakes): Stir in the minced garlic and chili flakes, and cook for 1 minute until fragrant.
Step 4 (Simmer Tomatoes): Pour in the diced tomatoes with their juices. Simmer for 5 minutes over medium heat, stirring occasionally.
Step 5 (Add Coconut Milk & Thicken): Stir in the full-fat coconut milk, mixing well to combine. Reduce the heat to low and let it simmer gently for 8–10 minutes until the sauce thickens slightly. Season with salt and black pepper to taste.
Step 6 (Toss With Pasta): Add the cooked spaghetti directly to the skillet and toss to coat the pasta evenly with the sauce, warming it together for 2–3 minutes (adding a splash of reserved pasta water if needed).
Step 7 (Garnish & Serve): Divide the pasta among warm serving plates or bowls, garnish with fresh basil leaves, and serve immediately!