Earliest References
כדעולא דאמר עולא חבריא מדכן בגלילא הכא נמי בימי רבי
The Gemara answers: This can be answered in accordance with the testimony of Ulla, as Ulla said: Ḥaverim purify their wine and oil in the Galilee, i.e., they produce their wine and oil by the standards of purity used for sacrificial food, in the hope that the Temple will be rebuilt in their lifetime. Here, too, in the days of Rabbi Yehuda HaNasi there were those who kept the standards of purity observed for sacrificial food.
(במדבר יג, כב) ויעלו בנגב ויבא עד חברון ויבאו מבעי ליה אמר רבא מלמד שפירש כלב מעצת מרגלים והלך ונשתטח על קברי אבות אמר להן אבותי בקשו עלי רחמים שאנצל מעצת מרגלים
It is also stated with regard to the spies: “And they went up into the south, and he came to Hebron” (Numbers 13:22). Why is the phrase “and he came” written in the singular form? The verse should have said: And they came. Rava says: This teaches that Caleb separated himself from the counsel of the other spies and went and prostrated himself on the graves of the forefathers in Hebron. He said to them: My forefathers, pray for mercy for me so that I will be saved from the counsel of the spies.
And furthermore, the Gemara relates that Rabbi Mani, Rabbi Yona’s son, was persecuted by members of the house of the Nasi. He prostrated himself upon his father’s grave and said to him: Father, Father, these men are persecuting me. One day, those men were passing there, by the grave, and the legs of their horses became stuck in the ground until they accepted upon themselves not to persecute Rabbi Mani anymore.
Sahih al-Bukhari, 435 (9th Century)
May Allah curse the Jews and the Christians, for they have taken the graves of their Prophets as places of worship.
The Custom Spreads
ועתה אכתוב מקום קברות הצדיקים, כפי אשר קבלתי ממורי זלה"ה, וכבר הודעתיך כי הוא היה רואה ומסתכל בנשמות הצדיקים, בכל מקום ובכל זמן, ומכ"ש בהיותו על קבריהם, ששם נפשותיהם עומדות כנודע, גם מרחוק עיניו יביטו בנפש הצדיק העומד על הקבר שלו, ועי"ז היה יודע קבר כל צדיק וצדיק, והיה מדבר עמהם, ולומד מהם כמה סתרי תורה. וכבר נסיתי כמה נסיונות וחקרתי בתכלית החקירות, ומצאתי דבריו כנים ואמתיים, ואין להאריך בזה עתה, כי הם דברים נוראים ונפלאים ולא יכלם ספר:
I will write about the burial places of the righteous as my master told them to me. As we have said before, he was able to see the souls of righteous people at any time and in any place, and even more so at their burial site, for that is where their Nefesh stands. Even from a distance, he could see the Nefesh of a righteous person standing on his burial place. This is how he came to know the burial place of each righteous person. He spoke with them and from them learned many secrets of Torah. On many occasions, I tested the information and did investigations. I found that everything was accurate and I have many amazing stories to tell, but the book would never be completed.
(translated by R. Yitzchak Bar-Chaim)
Potential Problems
Doresh el HaMeitim - Inquiring of the Dead
(יג) דורש אל המתים זה שמרעיב עצמו ולן בבית הקברות כדי שתשרה עליו רוח הטומאה:
Inquiring of the Dead means starving oneself and sleeping in a graveyard so that the unclean spirit will come upon him. (translation my own)
עוד ראיתי תשובה ע"ש מהר"ר חיים פלטיאל על הנודרים לילך לב"ה קצת היה נראה כדורש אל המתים דכלב שנשתטח על קברי אבות התפלל לשם במקום קדושה כדי שתהא תפילתו נשמעת וכדכתיב באברהם אל המקום אשר עמד שם אלמא שהמקום גורם. א"נ מי שביזה את המת ולכבודו משתטח על קברו זה מצינו אך נשים ובני אדם שאינן יודעין זה לא ידעתי הליכתן למה
Furthermore, I have seen a responsum from our teacher Rabbi Chaim Paltiel regarding those who are accustomed to go to a cemetery, that it seems close to doresh el hameitim (inquiring of the dead). When Calev prostrated at our forefathers' tombs he prayed there due to the holiness of the place so that his prayers would be heard. But someone who disgraces the dead by prostrating on his grave to honor him -- this is something we find only with women or those who don't understand these things -- I don't understand why they go there. (translation my own)
דביה"ק הוא מקום מנוחת הצדיקים והתפלה נתקבלה שם יותר אך אל ישים מגמתו נגד המתים אך יבקש מהש"י שיתן עליו רחמים בזכות הצדיקים שוכני עפר ויקיף הקברות ויתן צדקה קודם שיאמר התחנות. ואין לילך על קבר אחד ב"פ ביום אחד:
For a cemetery is the resting place of tzadikim (righteous people), and prayers are better accepted there. But don't aim your intentions towards the dead, but rather request of the Holy One, May He be Blessed, to have mercy on you in the merit of the tzadikim in the earth there. And encircle the cemetery, and give tzedakah (charity) before you make your pleas. And do not go to a grave twice in a single day. (translation my own)
Praying Inside a Cemetery
והתניא לא יהלך אדם בבית הקברות ותפילין בראשו וספר תורה בזרועו וקורא ואם עושה כן עובר משום לועג לרש חרף עושהו
Wasn’t it taught explicitly in a baraita: One may not walk in a cemetery with phylacteries on his head and a Torah scroll in his arm and read from it? If one does so he commits a transgression due to the verse: “He who mocks the poor blasphemes his Creator” (Proverbs 17:5).
Judaism Stresses Life, Not Death
(ה) וּשְׁמַרְתֶּ֤ם אֶת־חֻקֹּתַי֙ וְאֶת־מִשְׁפָּטַ֔י אֲשֶׁ֨ר יַעֲשֶׂ֥ה אֹתָ֛ם הָאָדָ֖ם וָחַ֣י בָּהֶ֑ם אֲנִ֖י יהוה׃
(5) You shall keep My laws and My rules, by the pursuit of which man shall live: I am the LORD.
(18) For it is not Sheol that praises You, Not [the Land of] Death that extols You; Nor do they who descend into the Pit Hope for Your grace. (19) The living, only the living Can give thanks to You As I do this day; Fathers relate to children Your acts of grace:
Halakhic Man, R. Joseph B. Soloveitchik, p. 31
Judaism has a negative attitude toward death: a corpse defiles; a grave defiles; a person who has been defiled by a corpse is defiled for seven days and is forbidden to eat any sacred offerings or enter the Temple; a Nazirite who has been defiled by a corpse cancels his previous count and must carry out the shaving of his head for defilement and bring an offering; the priests of God are forbidden to defile themselves with the dead....
Authentic Judaism as reflected in halakhic thought sees in death a terrifying contradiction to the whole of religious life. Death negates the entire magnificent experience of halakhic man....
Praying Through Intermediaries
אֲנִי מַאֲמִין בֶּאֱמוּנָה שְׁלֵמָה, שֶׁהַבּורֵא יִתְבָּרַךְ שְׁמו לו לְבַדּו רָאוּי לְהִתְפַּלֵּל, וְאֵין רָאוּי לְהִתְפַּלֵּל לְזוּלָתו.
I believe with perfect faith that solely the Creator His name be blessed is fit to be prayed to, and it is unfit to pray to any other being.
שלא יהיה מקום קבורתו נודע לאחד מהאנשים והנה עשה זה השם יתעלה כי אולי אם נודע מקום טעו יעטו הדורות הבאים ויעשו ממנו אלוה
...so that his place of burial should not be known to anyone. And Hashem did this since if his burial place were known, perhaps someone in future generations might err and turn him into a god. (translation my own)
אבל הקב"ה אינו כן אם בא על אדם צרה לא יצווח לא למיכאל ולא לגבריאל אלא לי יצווח ואני עונה לו מיד.
But the Holy One Blessed Be He is not like that. If a person is in need, he should not cry out to [the angels] Michael and Gabriel. He should cry out to Me and I will answer him immediately. (translation my own)
בכה רבי ואמר מה בחייהן כך במיתתן על אחת כמה וכמה
Rabbi Yehuda HaNasi wept and said: If during their lifetimes it is so that the righteous are great, after their death it is all the more so true.
Should We Visit Cemeteries At All?
וְלֹא יִפְנֶה אָדָם לְבַקֵּר הַקְּבָרוֹת:
(4) One should not visit the graves. (translation my own)
ותישמר שלא תלך לבית הקברות כלל וכלל. (נ"א: ששם מתדבקין הקליפות מאד וכל שכן בנשים), וכל הצרות והעוונות באים מזה.
Refrain also from going to the cemetery (especially women), as it leads to all kinds of sorrow and sin.
Halakhic Man, R. Joseph B. Soloveitchik, p. 36
The Gaon of Vilna, R. Joseph Dov Soloveitchik, his son, R. Hayyim, his grandson, R. Moses, R. Elijah Pruzna [Feinstein] never visited cemeteries and never prostrated themselves upon the graves of their ancestors. The memory of death would have distracted them from their intensive efforts to study the Torah.
Potential for Inappropriate Worship
קבריה דרב הוו שקלי מיניה עפרא לאישתא בת יומא אתו אמרו ליה לשמואל אמר להו יאות עבדין קרקע עולם הוא וקרקע עולם אינה נאסרת
It was related that people would take dirt from the grave of Rav as a cure for a one-day fever. A number of people came and told Shmuel about this practice, thinking that perhaps the dirt should be forbidden, as one may not derive benefit from a corpse. Shmuel said to them: They are acting properly, as the dirt in the grave is natural ground, and natural ground does not become forbidden in any situation.
Are They Even Accurate?
Matthew 2:16-18
...[Herod] gave orders to kill all the boys in Bethlehem and its vicinity who were two years old and under... Then what was said through the prophet Jeremiah was fulfilled: "A voice is heard in Ramah, weeping and great mourning, Rachel weeping for her children..."
ואקברה שם ...כלומר בדרך אשר יעברו בה בניה מתה ושם קברתיה לטובתם כי היא לא מתה בדרך רק ברמה שהיא עיר בארץ בנימין ושם נקברה
And buried her there... That is to say, as her son was being born she died and was buried there for their good. Because she didn't die on the road, but in Ramah, which is a city in the area of Binyamin, and there she was buried. (translation my own)
כברת ארץ ...זה כתבתי תחילה ועכשיו שזכיתי ובאתי אני לירושלם שבח לאל הטוב והמטיב ראיתי בעיני שאין מן קבורת רחל לבית לחם אפילו מיל... וכן ראיתי שאין קבורה ברמה ולא קרוב לה אבל הרמה אשר לבנימן רחוק ממנה... על כן אני אומר שהכתוב שאומר קול ברמה נשמע (ירמיהו לא יד) מליצה כדרך משל לאמר כי היתה רחל צועקת בקול גדול ומספד מר עד שנשמע הקול למרחוק ברמה שהיא בראש ההר לבנה בנימן כי איננו שם.
Kivrat Aretz ...This I wrote originally, but now that I have merited to come to Jerusalem, praise be to the great and wonderful God, I saw with my eyes that there is only a small distance (not even a mil) between Rachel's Tomb and Bethlehem... and I saw that there is no burial in Ramah, nor near it. And the Ramah in [the territory of] Benjamin is far from it... Therefore, I say that the sentence that writes "A voice is heard in Ramah" (Jeremiah 31:14) is written as a parable saying that Rachel cried out with a loud voice and bitter suffering, until her voice was heard far away in Ramah, that is on the top of the mountain of her son Benjamin, which is not there. (translation my own)
וַיִּשְׁכַּ֥ב דָּוִ֖ד עִם־אֲבֹתָ֑יו וַיִּקָּבֵ֖ר בְּעִ֥יר דָּוִֽד׃
So David slept with his fathers, and he was buried in the City of David.
So What Can We Do?
ויתן לצדקה מה שהיה מוציא על הדרך ואח"כ יתן מה שנשער כפי שהיה טרחו והילוכו וזה יתן לצדקה וינצל מצעקה
And they should give charity in the amount that they would have spent on the journey, and afterwards he should also give the amount that he estimates as [the value of] the time and trouble involved in the journey, and this will save him. (translation my own)
למה יוצאין לבית הקברות פליגי בה ר' לוי בר חמא ור' חנינא חד אמר הרי אנו חשובין לפניך כמתים וחד אמר כדי שיבקשו עלינו מתים רחמים
The Gemara further asks: And why do they go out to the cemetery on a fast day? Again, Rabbi Levi bar Ḥama and Rabbi Ḥanina disagree with regard to this matter. One said this is as though to say: We are like the dead before You. And one said that one goes out to the cemetery in order that the deceased will request mercy on our behalf.
נוהגים שלא לשחוט ושלא להכין צורכי סעודה עד אחר חצות: הגה והולכין על הקברות מיד שהולכים מבית הכנסת [ב"י בשם תוס']:
(10) We are accustomed not to slaughter animals, or prepare for any needs of a meal, until after chatzot. [Note {from the Rem"a} -- and we go to visit graves directly after synagogue {Beit Yosef in the name of Tosafot}]
על הקברות - של ישראל כדי שיבקשו עלינו רחמים ואם אין של ישראל הולכים אפילו על קברי עכו"ם לומר שאנו חשובין כמתים
To Graves -- of Israel, to request mercy for ourselves. And if there are no Jewish graves, go even to non-Jewish graves, to say, "We are to be considered [worthless] like dead people." (translation my own)
וּמוֹשִׁיבִין יְשִׁיבָה עַל קִבְרוֹ שִׁבְעָה יָמִים. שֶׁנֶּאֱמַר (דברי הימים ב לב לג) "וְכָבוֹד עָשׂוּ לוֹ בְמוֹתוֹ" זֶה שֶׁהוֹשִׁיבוּ לוֹ יְשִׁיבָה עַל קִבְרוֹ. וְנָשִׂיא שֶׁמֵּת אֵין מְבַטְּלִין יְשִׁיבָתוֹ יֶתֶר עַל שְׁלֹשִׁים יוֹם:
And they establish a yeshiva on his [a king's] grave for seven days. As it is written (II Chronicles 32:33) "And they honored him in his death." This means they established a yeshiva on his grave. And for a Nasi [head of the Sanhedrin] we do not remove his yeshiva for thirty days.
(דברי הימים ב לב, לג) וכבוד עשו לו במותו מלמד שהושיבו ישיבה על קברו... א"ל ר' נחמיה... שהניחו ס"ת על מטתו ואמרו קיים זה מה שכתוב בזה והאידנא נמי עבדינן הכי אפוקי מפקינן אנוחי לא מנחינן
The Gemara, above, cited a verse concerning King Hezekiah’s burial. The Gemara cites the continuation of that verse: “And they afforded him honor in his death” (II Chronicles 32:33). This teaches that they established a yeshiva at his grave to study Torah there.... Rabbi Neḥemya said ...The honor that was done for Hezekiah was that they laid a Torah scroll upon his bier and they said: This one, i.e., Hezekiah, fulfilled that which is written in this, i.e., the Torah scroll. The Gemara asks: But nowadays as well, we do this for any great Torah scholar that dies, so what is unique about what was done to honor Hezekiah? The Gemara answers: Nowadays, we take a Torah scroll out but we do not lay it on the bier of the deceased.
רבן שמעון בן גמליאל אומר אין עושין נפשות לצדיקים דבריהם הן הן זכרונן
Rabban Shimon ben Gamliel says, "We do not make grave markers for tzadikim [righteous people]. Their words are their memorial."