It is stated in Berakhot (23b): A person should not hold tefillin in his hand or a Sefer Torah in his arm and pray. This is because his mind is not settled upon him during prayer, for his heart is always upon them so that they do not fall from his hand (Rashi). And it is stated there that also a knife, and money, and a bowl, and a loaf of bread—it is forbidden to hold during the time of prayer, because he worries about them: that the knife might fall and injure him, the money might be lost, the bowl might spill, and the loaf might become soiled (ibid.). And it implies that specifically something for which there is a transgression in their falling, like a Sefer Torah and tefillin, or something where there is physical damage to his body in its falling like a knife, or monetary loss like money and a bowl and a loaf. But something for which there is no concern in their falling, like strings and handkerchiefs—it is permitted. However, there is one who says that initially it is forbidden to hold any object in his hand during the time of Shmoneh Esreh (Bach). And certainly it is so, rather the Gemara enumerated those things for which there is a complete prohibition because the distraction from them is greater. But initially one should not hold any object in his hand. And there is one who says that regarding all those which the Shas enumerated—if he held them in his hand, he must repeat the prayer (Bach). And these are wondering words, even according to the time of the Shas when they would repeat for a lack of kavanah (Taz, subsection 1 and Eliyah Rabbah). And so it is explained from the words of the Rambam, unless he said that he did not focus because of this, for then according to their time he repeats. But we do not repeat for a lack of kavanah, as I wrote in siman 93, section 2, see there.
איתא בברכות (כג ב): לא יאחוז אדם תפילין בידו וספר תורה בזרועו ויתפלל. מפני שאין דעתו מיושבת עליו בתפילה, שהרי לבו תמיד עליהן שלא יפלו מידו (רש"י). ואיתא שם דגם סכין, ומעות, וקערה, וככר – אסור לאחוז בשעת תפילה, מפני שדואג עליהם שלא יפול הסכין ויזיקנו, והמעות יאבדו, והקערה תשפך, והככר תטנף (שם). ומשמע דדווקא דבר שיש עבירה בנפילתן, כמו ספר תורה ותפילין, או דבר שיש נזק לגופו בנפילתו כמו סכין, או היזק ממון כמעות וקערה וככר. אבל דבר שאין שום חשש בנפילתן, כמו חוטים ומטפחות – מותר. אבל יש מי שאומר דלכתחילה אסור לתפוש שום דבר בידו בשעת שמונה עשרה (ב"ח). ובוודאי כן הוא, אלא דהגמרא חשבה במה שיש איסור גמור שהטירדא מרובה מזה. אבל לכתחילה אין לתפוש שום דבר בידו. ויש מי שאומר דכל אלו שחשב הש"ס – אם תפסן בידו צריך לחזור ולהתפלל (ב"ח). ודברים תמוהים הם, אפילו לפי זמן הש"ס שהיו חוזרים בשביל חסרון כוונה (ט"ז סעיף קטן א' ואליה רבה). וכן מתבאר מדברי הרמב"ם, אלא אם כן אמר שלא כיון בשביל זה, דאז לפי זמנם חוזר. ואנו אין חוזרין בשביל חסרון כוונה, כמו שכתבתי בסימן צ"ג סעיף ב, עיין שם.