Hayim initially studied in his father's library, and, at the age of 10, he left midrash and began to study with his uncle, David Hai Ben Meir, who later founded the Shoshanim LeDavidYeshiva in Jerusalem. In 1851, he married Rachel, the niece of Abdallah Somekh, his prime mentor, with whom he had a daughter and two sons. When Hayim was only twenty-five years old, his father died. Despite his youth, the Jews of Baghdadaccepted him to fill his father's place as the leading rabbinic scholar of Baghdad, though he never filled the official position of Hakham Bashi. The Sephardic Porat Yosef Yeshiva in Jerusalem, was founded on his advice by Joseph Shalom, of Calcutta, India—one of Hayim's patrons. Hayim clashed with the reformist Bavarian Jewish scholar Jacob Obermeyer who lived in Baghdad from 1869 to 1880, and excommunicated him. Part of the contention was due to Obermeyer and Hayim's conflicting views on promotion of the Zohar.
Works
The Ben Ish Hai is a standard reference in some Sephardi homes and is widely studied in Sephardi yeshivot. Due to the popularity of this book, Hakham Yosef Hayim came to be known as "Ben Ish Hai", by which he is referred to by many today. The book is a collection of homilies he gave over two years discussing the weekly Torahportion. Each chapter begins with a mystical discussion, usually explaining how a Kabbalistic interpretation of a certain verse relates to a particular halakha, and then continuing to expound on that halakha with definitive rulings. Hakham Yosef Hayim authored over thirty other works, and there are many published Iraqi ritesiddurim based on his rulings, which are widely used by Sephardi Jews. Amongst the best known of his works are:
Me-Kabtziel : an esoteric exposition of Jewish law — which he refers to often in Ben Ish Hai — providing a more detailed explanation of the reasoning underlying certain decisions. It has been speculated that Hakham Yosef Hayim's insistence on having all his works printed in the Land of Israel prevented this essential work from being published.
Ben Yehoyada and Benayahou: his commentary on the Talmud, considered a basic resource in understanding the Aggada.
The names Ben Ish Hai, Me-Kabtziel, Rav Pe'alim and Ben Yehoyada derive from 2 Samuel . He chose these names because he claimed to have been a reincarnation of Benayahu ben Yehoyada ; the man in whose merit, it is said, both the first and second Holy Temples stood. Hakham Yosef Hayim was also noted for his stories and parables. Some are scattered through his halakhic works, but have since been collected and published separately; others were published as separate works in his lifetime, as an alternative to the European-inspired secular literature that was becoming popular at the time. His is a book filled with parables concerning self-improvement. The book, directed towards, but not limited to women, is rare since it was composed in Judeo-Arabic. It was last published in Israel in the 1940s.