Like many of his fellow Americans, James Downey was a bit surprised to see Senator Hillary Rodham Clinton on “Saturday Night Live” over the weekend, satirically protesting the treatment she has received from the news media.

But Mr. Downey, 55, a veteran writer of the show, must have been flattered by Mrs. Clinton’s cameo. After all she was just agreeing with his handiwork: a pair of comedy skits in which debate moderators give the candidate a tough grilling while fawning over her Democratic rival, Senator Barack Obama.

Mrs. Clinton even cited one of Mr. Downey’s “SNL” sketches during a debate on Tuesday, when she complained that she seemed to be receiving tougher questions than Mr. Obama.

“If anybody saw ‘Saturday Night Live,’ ” she said, “you know, maybe we should ask Barack if he’s comfortable and needs another pillow.”