Why does elavil or amitriptyline make you gain weight?

Antihistamine. The antihistamine effect of Amitriptyline is what stimulates appetite and ultimately leads to weight gain (also causes sleepiness). This class of tricyclic antidepressants (called tertiary amines) tends to have stronger antihistamine effect. The secondary amines like nortriptyline and desiprimine have less of the antihistamine effect.
Histamine. Likely related to h1 histamine blockade, some to Alpha adrenergic effects.
Not sure, but --- Med can change metabolism or appetite. When we feel better we eat moe. When we dont feel well we often eat more too.. So these comfort easing eating behaviors create obese societies. There are complex brain centers that control are eating and these meds maybe working at these areas also .