When Skye came home from karate class, she found her mother in her bedroom. “She told me to come over,” Skye said. “And there was a butterfly sitting in my room. I just kind of sat there looking at it with my mom.”

The male swallowtail, a striking insect with asymmetrical yellow crescents, a splash of blue and distinct orange eyespots on a black canvas, preferred the texture of Skye’s bedsheet, but it made her a little anxious. “I didn’t want it landing on the bed during the night and then I rolled over and hurt it,” said Skye, a sixth-grader at the Brooklyn School of Inquiry in Bensonhurst.

For four days, Skye chose to sleep in what the family calls the workroom, while other potential habitats were considered.

Finally, the family — which includes Skye’s father, Salvatore Perry, also an architect — decided on the smaller of their two bathrooms, a 5-foot by 9-foot space completely given over to the butterfly. Every conceivable space and fixture is softly blanketed in pristine white sheets and towels. Tiny evergreen sprigs saved from the Christmas tree and shallow bowls of homemade nectar rest spalike on the sink. A saucer of moss offers another plush landing pad.

“It prefers warm, soft textures to cold slippery tile,” Ms. Rothstein said of her guest.

From the beginning, Skye and her mother felt responsible for the butterfly that had chosen them. Trying to figure out how best to care for it, Skye emailed this reporter, who is also her science teacher, for advice. The suggestion was to prepare a mix of 10 parts water and one part honey and then use a needle to coax the tiny thread of the butterfly’s proboscis into the elixir. It was a success.