Heat a large stockpot of salted water to a boil over high heat; add crab legs; cover. Cook until crab is cooked through, 6 minutes; transfer crab to a colander but don't drain the water out of the pot, keep it boiling.
Add spaghetti to the crab water; cook according to package directions. Drain; keep warm. Meanwhile, crack crab legs into smaller, more manageable pieces.
Melt 3 T. of the butter in a large skillet or wok. Add garlic; cook, stirring, until garlic is slightly browned and aromatic, about 2 minutes. Add crab legs and parsley to skillet; toss to coat the shells and the meat with the hot butter and garlic. Transfer to a plate and set aside.
Melt remaining 1 T. butter in the skillet over medium heat. Add cooked pasta, tossing until well coated. Transfer pasta to a platter; top with reserved crab.