The Sefer Hasidim or Sefer Chassidim (, Book of the Pious) is a text attributed to Judah ben Samuel of Regensburg (died 1217), a foundation work of the teachings of the Chassidei Ashkenaz ("Pious Ones of Germany"). It offers an account of the day-to-day religious life of Jews in medieval Germany, and their customs, beliefs, and traditions. It presents the combined teachings of the three leaders of German Hasidism during the 12th and 13th centuries: Samuel the Chassid, Judah the Chassid of Regensburg (his son), and Elazar Rokeach.

Contents
Sefer Hasidim is made up of teachings from the Hasidei Ashkenaz movement from the 12th and early 13th centuries. Only 2 versions of the book have survived: one printed in Bologna and another that was found in Parma. The book contains ethical, ascetic, and mystical teachings, intermingled with elements of German popular belief. It discusses ethics and how they relate to everyday Jewish life, dealing with a variety of topics including piety (heading, Shemuel; so-called Sefer HaYir'ah); (§§ 14–26), reward and punishment, penitence, the hereafter, etc. (heading, Sefer HaḤasidim; so-called Sefer Teshuvah); (§§ 27–489), authorship of the book, pride, the hereafter and retribution, penitence and sinful desires, fasting and fast-days, suspicion, public mortification, martyrdom, etc. (heading, Zeh Sefer ha-Ḥasidim); (§§ 490–638), the Sabbath; (§§ 639–746), tefillin, ẓiẓit, mezuzot, books; (§§ 747–856), the study of the Law; (§§ 857–929), charity; (§§ 930–970), reverence for parents; (§§ 971–1386), piety, worship of God, prayer, visiting the sick, etc.; (§§ 1387–1426), excommunication and oaths; the final paragraphs repeat and amplify upon matter previously discussed.

This text takes into consideration the specific circumstances of these ethical situations including the individual character qualities of the subject, historical and economic context, and the subjects relationship to other people, making it an extremely important text when it comes to everyday Jewish life in medieval Germany.
It serves as a guide for how to handle life's common tasks and challenges. There is no other ethical Hebrew text that covers as many topics while retaining close attention to realistic detail as Sefer Hasidim. Sefer Hasidim even served as a final authority on the way of Jewish life for the for authors of Halakah after the 15th century. 

It consists, according to the edition of Basel, of 1,172 paragraphs; according to the last edition, of 1,903. Chosen parts have been translated into German by Zunz. The Book of the Pious is an exceedingly rich source for the Kulturgeschichte of the Jews in the Middle Ages.

Authorship and history
Sefer Hasidim is not a uniform work, nor is it the product of one author. It has been said that Samuel he-Ḥasid is the author of the first twenty-six sections. In its present form the book contains, according to Güdemann, three revisions of the same original work, of which Judah is undoubtedly the author; and both the contents and language of the book indicate that it originated in Germany. Important additions were made also by Judah's pupil Eleazar Roḳeaḥ, for which reason the authorship of the whole work has sometimes been ascribed to him. On account of the fact that collectors and copyists used varying recensions, sometimes the same passage occurs two or three times in different parts of the Sefer Ḥasidim. Some fragments of other books are inserted.
This Hebrew book originated between the late 12th and early 13th centuries in the Rhineland, shortly after the Second Crusade. After this time, it circulated widely. It influenced the distinctive religious practices and Hebrew literary style of Jews in Ashkenaz and also shaped the discourse about Jewish ethics in medieval Europe and beyond.

The book has been printed many times since 1538. 

Several manuscripts are in existence, some more extensive than others. An edition by Jehuda Wistinetzki based on the most complete source, the Parma manuscript, was published by the Mekitzei Nirdamim Society in 1891 and reprinted in 1955. Recently Otzar haPoskim Institute has published an elaborate version with numerous commentaries.

According to Ivan Marcus, no original text of the Sefer Hasidim ever existed.
It is therefore no surprise, then, that thirty-seven manuscripts that include texts from the Sefer Hasidim have been identified.

Seventeen of these manuscripts are available online in the 
It appears that Judah HaHasid most likely was not the sole author of the Sefer Hasidim.

The suggestion that he was part of a group termed Hasidim (the Pious), was challenged recently by Elisheva Baumgarten, who has studied the term Hasid/ah, and suggested it did not refer to a particular group or movement, but rather to honest members of the community who fulfilled their religious and social obligations.

Some studies address subjects included within Sefer Hasidim. These include the subject of Jewish travel, and the attitude toward music.

Commentaries on Sefer Hasidim
 Brit Olam by Chaim Joseph David Azulai, with additions Shomer ha-Brit
 Mishnat Chassidim by Saadia Helvona
 Mekor Chesed by Reuvein Margolies (1924, printed in the Mossad Harav Kook edition)
 Mishnat Avraham by Avraham Aharon Price (1955, Mikitzei Nirdamim edition)

References

Jewish medieval literature

External links 
 Hebrew text available on Sefaria