This is a formal analysis of how homeless shelters should operate: in particular, what quality of accommodations they should provide and how they should help their residents in securing conventional housing. I also examine timing. The results extend to cover optimal police response to street homelessness as well. I draw heavily on the unemployment insurance literature.