In Adas Tzaddikim it relates that when the Rema became Av Beis Din Cracow, he took Rav Chaim as his segan (assistant rav) and that when the Rema traveled, Rav Chaim acted as chief rabbi in the Rema’s place as Av Beis Din.
It happened, that Rav Chaim’s wife passed away. The Rema was so dependent on Rav Chaim and the communal responsibilities so great that all shidduch suggestions for Rav Chaim were discounted. Everyone anticipated the Rema’s approval of some match. Rav Chaim, seeing how things were going, took matters into his own hands. Tradition has it that he made a secret match through a shadchan with a local baker. The simple, but pious, baker supplied his illustrious son-in-law to be, with all the seforim he would need along with a hidden room to study undisturbed. The Rema returned one day to find Rav Chaim melancholy. He surmised that it was for lack of a suitable match and proposed that he would indeed find Rav Chaim a new wife. Rav Chaim staged that he wished to visit his family and left with intentional fanfare. He was escorted by the Rema and the townspeople out of the city limits where he dressed in simple clothes, gathered a minyan at the baker’s residence and married his daughter in a clandestine chuppah. After the wedding, he set himself up in the room provided by his father-in-law and studied happily and undisturbed for some two years until he was discovered.
There was a plague in Cracow and someone assumed that the secretive baker’s son-in-law whom no one knew must be the culprit behind some crime that made Cracow guilty. Such was the desperate calculation of people trying to find some reason why the plague had struck their city. Rav Chaim was summoned before the Rema, and was found to have been hiding all this time! Consequently, Rav Chaim was released and cleared of all charges.
“Why did you hide; what was your sin? And why are you laughing?” asked the Rema when he saw Rav Chaim laugh.
“I hid because the communal responsibilities were too much for me and it disturbed my Torah study,” Rav Chaim explained. “I laughed because these simple people were so quick to judge me and I can see they were just all too happy to whip me soon as you gave them the word. Apparently, my sin was that my Torah study was so good that I almost grew arrogant. But then, Hashem put me in a situation where I would be shamed!”
When the Rema went to visit him to see what he meant, he overheard Rav Chaim studying with someone else. But when he came inside, Rav Chaim was alone.
“I command you to reveal who was here!” said the Rema.
Rav Chaim admitted he had been studying with Eliyahu HaNavi.
“And he is still here with us,” said Rav Chaim.
Eliyahu then told the Rema that he studied with Rav Chaim, not because Rav Chaim was greater than the Rema, but because the Rema’s greatness and strength in Torah was too much for him [Eliyahu Hanavi]!
