I heard that there is an idea of not leaving a Sefer open because it can cause forgetfulness.
Is this idea written about anywhere in Halachic literature? If so where is it located?
This exact question was posed to R. Joseph Messas in Otzar Hamichtavim Vol. II # 954.
שאלת ידידי במכתבך להודיעך אם אמת הדבר אשר שמעת שהמניח ספר פתוח ויוצא בא לידי שכחה ואם דבר זה הוא אפי' בספרי דפוס או רק בס"ת תשובה דבר זה הוא מפורש בהבאה"ט ביו"ד סי' רע"ז וזה"ל וכתב הש"ך וידוע לחכמי האמת דיש מלאך אחד נקרא ש"ד והוא שומר דפין על מי שמניח ספר פתוח ויוצא שמשכח תלמודו ולאו דוקא ס"ת אלא הה"ד שאר ספרים ע"ש וזה דבר סגוליי בלי טעם ושלום
You asked, my friend, in your letter, to inform you whether that which you heard – that if one leaves an open sefer and departs he will come to forget – is true, and if it applies even to printed sefarim or only to a Sefer Torah. Answer: This idea is explicit in the Ba'er Heitev in Yoreh Deiah siman 277, and these are his words. "And the Shach wrote that it is known to the Sages of Truth that there is an angel called S"D and he watches the pages over one who leaves an open sefer and departs, that he should forget his learning. And this is not limited to a Sefer Torah; the same is true for other sefarim". See there. And this is a mystical idea; it has no reason. Peace.
Shmuel I 24:12 "As I have cut off the corner of your robe and not killed you, so you know that I do not mean you any harm."
Melachim I 1:1 "King David was old and advanced in years, and they covered him with clothes, but he wasn't warmed."
My Rosh Yeshiva's son in law; Rav Smith from Kensington, taught me the reason why leaving a sefer open causes forgetting of learning.
When King David cut the corner of King Shaul's garment, he was held accountable, on one level, for disrespecting clothing. Later in life, Hashem caused that clothing would not help him keep warm, as an atonement for cutting the cloak's corner years before.(see Gemara Brachos 62b and Rashi on Melachim 1:1)
Hashem takes account measure for measure (middah k'negged midah).
By disrespecting clothing, one justly loses the benefit of clothing (warmth).
By disrespecting a Torah book (leaving it open and abandoned) one justly stands to lose the benefit of that book (= forgetting one's learning).
There are some opinions which allow one to leave a sefer open if it is obvious you are not intending to abandon it strewn open, and are returning to learn further. See Yoreh Deah 277 with the commentary of the Aruch HaShulchan.