Preheat oven to 375°F. Cook shells until just al dente; drain and cool.
Sauté onion and garlic in olive oil until soft. Add crushed tomatoes and basil stems; simmer 10 minutes, season.
Mix ricotta, half the mozzarella, spinach, egg, Parmesan, salt, and pepper.
Spoon filling into shells and arrange in a baking dish with a little sauce on the bottom.
Pour remaining sauce over shells, top with leftover mozzarella, cover with foil.
Bake 20 minutes, remove foil and bake 5–8 more minutes until cheese bubbles. Discard stems before serving.