Very cramped quarters, as in “There’s not enough room to swing a cat in this tent.”
The earliest citation for the phrase was in 1665, by which point it would already have been in common use, and may have originated in naval slang. It is commonly thought to allude to the cat-o’-nine-tails, or “cat,” a whip with nine lashes often used to punish offenders in the British Royal Navy. The punishment of whipping was administered on the poop or upper deck of a ship, because on the main decks below there wasn’t room to swing a “cat.”
This “cat” whip got its name from the fact that the welts it left on a sailor’s back looked like enormous cat scratches.
However, the earliest citation for “cat-o’-nine-tails” isn’t until 1695, some 30 years later, in William Congreve’s Love for Love:
“If you should give such language at sea, you’d have a cat-o’-nine-tails laid cross your shoulders.”
If those dates are indeed the earliest uses, then the ‘cat-o’-nine-tails’ theory is wrong, and hence this idiom presumably derived from literally swinging a cat around by the tail.
This version seems to have quite a bit more evidence in its favor, the phrase having come into use in the mid-17th century and being used with clear reference to actual cats, including in Charles Dickens’ David Copperfield.
But the likely explanations are gruesome, and certainly loathsome to a cat-lover like me. Cats were used in target practice during the 16th century. The 1898 Dictionary of Phrase and Fable says that sometimes “two cats were swung by their tails over a rope.” At other times, according to the dictionary, a cat in a bag or a sack (leather bottle) “was swung to the bough of a tree.”
Shakespeare refers to the practice in 1599 in Much Ado About Nothing: “… hang me in a bottle like a Cat, and shoot at me; and he that hits me, let him be clapped on the shoulder, and called Adam.”
When Mark Twain used the phrase “swing a cat” in the 19th century in Innocents Abroad, he was obviously referring to a four-legged cat: “Notwithstanding all this furniture, there was still room to turn around in, but not to swing a cat in, at least with entire security to the cat.”
One more theory offered is that “cat” is a cat boat, which is a small sailboat with its mast stepped in the bow. The swing referred to is the room necessary for the anchored boat to swing with the tide without fouling the lines of other vessels. But this one is easily dismissed since cat boats date only from the 1840s, and people have been writing about swinging cats since the 1660s.