Panini who wrote astadhyayi on Sanskrit grammar was present during the time of mahabharata, some sites claim that he was also a character in Mahabharata, which passages in the epic mention Panini?
There is no mention of Pāṇini in Bibek Debroy's translation based on the Critical Edition of the Mahābhārata.
Also, according to Subhash Kak's essay The Mahabharata and the Sindhu-Sarasvati Tradition, the older portions of the Mahābhārata epic do not follow Pāṇini's grammar. When the work itself is older than Pāṇini, how can Pāṇini be a character in it?
The Mahabharata Epic and Archaeology
Panini's grammar (c. 400 BC) knows the Mahabharata. In the sutra 6.2.38, it mentions both the Bharata and the Mahabharata. Also, the Epic, in its long descriptions of the religions of the day, describes the Vedic, Sankhya, Yoga, Pasupata, and the Bhagavata traditions. There is no mention of Buddhism, so we can be certain that it was substantially complete prior to 400 or 500 BC. The language of the Epic does not always follow Paninian constructions which also indicates that it is prior to 500 BC.
The material from the Mahabharata and the Puranas provides us many tangled hints. Given the extensive nature of the king-lists and the teacher-lists it is impossible that the origin of the Mahabharata-Purana tradition could be brought down to the beginning of the second millennium BC as espoused by the proponents of the theories of Aryan invasion and migration. The Mahabharata War occurs at the 94th generation in these lists, and even if one were to assign just 20 years for each generation and assume that the lists were exhaustive, one would have to account for nearly 2,000 years before the War which, even in the most conservative dating for the War, takes us square into the beginnings of the Integration Era of the SS [Sindhu-Sarasvati] Tradition.
The Epic and Puranic evidence on the geographical situation supports the notion of the shifting of the centre of the Vedic world from the Sarasvati to the Ganga region in early second millennium BC. O.P. Bharadwaj's excellent study of the Vedic Sarasvati using textual evidence supports the theory that the Rgveda is to be dated about 3000 BC and the Mahabharata War must have occurred about that time.
The Mahabharata clearly belongs to a heroic age, prior to the rise of the complexity of urban life. The weapons used are mythical or clubs. The narrative of chariots could be a later gloss added in the first millennium BC. The pre-urban core events of the Epic would fit the 3137 BC date much better than the 1924 BC. But this would suggest that the Puranic tradition at a later time conflated earlier events with the destructive earthquakes of 1924 BC and remembered the later event accurately using the centennial Saptarsi calendar. The Indic kings of West Asia are descendents of Vedic people who moved West after the catastrophe of 1924 BC.