1. Preheat oven to 375 degrees Fahrenheit.
2. Cut the spaghetti squash in half and remove the seeds.
3. Place the squash face down in a baking dish or on a rimmed cookie sheet with a small amount of water.
4. Bake about 45 minutes or until just tender and the inside flakes away in noodle-like strings.
5. While the squash is cooking, heat up one tablespoon oil in a pan and add diced onion. Sauté until translucent. Add the chicken. (Add extra oil if needed.) Season with salt and pepper and sauté until cooked through, about 15 minutes more.
6. When the squash is finished cooking, scrape the inside of it out into large bowl. It should resemble pasta.
7. Add chicken to the squash pasta.
8. Drizzle with olive oil, add the pesto and toss well. Garnish with basil and optional poached egg.