Haguregumo is set in the Bakumatsu, the turbulent period at the end of the Tokugawa Shogunate, after the "opening" of Japan in 1854. The country was being torn apart by competing factions - modernizers trying to apply Western technology and ideas to Japanese society; Imperial loyalists, trying to reassert to the ascendancy of the Emperor; and the forces of the Shogunate, trying to defend the military bureaucracy (bakufu) against all comers. The bakufu organized special police squads, notably the Shinsengumi and the Mimawarigumi, to "defend public order" and assassinate opponents. (In popular culture, they are all lumped together as the Shinsengumi.) Covert violence and even open warfare were commonplace.
The movie covers 1866 and 1867. It tells the story of a retired samurai, Kumosuke (or Kumo, for short), who is living quietly, not to say idly, in Edo (old Tokyo) with his wife and two children, a young boy named Shinnosuke and an infant girl, Ohana. While he nominally runs a courier business to earn a living, he seems to spend most of his time smoking his pipe, drinking sake, and chasing women. The arrival of a Shinsengumi squad led by a young swordswman, Ichimonji Hyougo, disrupts this peaceful routine. Kumo is forced to use his still-sharp sword skills to defend himself, but he'd basically prefer to stay out of the treacherous political currents. Nonetheless, he ends up saving Ryouma Sakamoto (a famous Westernizer) from the Shinsengumi and teaching Ichimonji the futility of the warrior way.
(Source: Soldado-Subs and Saizen)