Would that just be: "cogitas quid cogito?"
"Are you thinking what I'm thinking?" in Latin
idiom - "Any thoughts" in Latin - Latin Language Stack Exchange
The Original Thought
How do you say "lost in thought" in Latin? - Latin Language Stack Exchange
Borrowing an expression from Cicero, I would suggest:
Cogitatione alio ductus
Which might be translated:
Led elsewhere (or carried away) in thought
This expression comes from Cicero's De Oratore Ad Quintum Fratrem:
Id accidere credo, vel quod ingeni specimen est quoddam transilire ante pedes posita et alia longe repetita sumere; vel quod is, qui audit, alio ducitur cogitatione neque tamen aberrat, quae maxima est delectatio; (De Oratore Ad Quintum Fratrem Book III, chap. XXXIX, §160)
(I believe this happens, either because it is some indication of intellect to leap over such expressions placed before you and take up others from a greater distance; or because the listener is led elsewhere in thought, while not straying from the subject, which is quite a pleasure.)
Another option:
In light of cmw's comment, I'm including another possibility suggested by Cicero's same sentence:
Cogitatione aberrans
Which might be translated as:
Wandering away (or going astray) in thought
Whether one is carried away or wandering away, I believe that both ideas are suggestive of being lost in thought. As cmw pointed out, going astray in thought may be better suited for conveying the idea of being oblivious to one's surroundings.
For the meaning of being consumed in thought so that to lose touch with surrounding, several options might be suggested.
L&S suggests oblivisci sui (literraly: "to forget oneself"), it was suggested by @cmw in a question about distraction resulting in forgetting. However it seems oblivisci sui is wider in meaning than "lost in thought". I believe it is possible to add an ablative of cause/manner to make it clearer, something like "esse oblitus sui (a) cogitatione/cogitando de hac re"; Or, even using present participle esse oblitus sui cogitans de hac re
With respect to the suggested perditus/amissus in cogitatione, it seems to me perditus is a bit stronger and has negative connotation for the sense we seek here; id est, something like perditus (in) cogitatione is likely to get interpreted as "he got ruin/devastated with that thought" - i.e., the thought had negative effect on him. With respect to amissus (in) cogitatione, for time being I could not attest kind of this usage; furthermore in a brief scan, I could not find even one instance of a person as the direct object of amitto in the sense we are seeking, let alone se (with perdo such examples of person direct object can be found that quoted in L&S entry for perdo), hence I would say that amissus (in) cogitatione seems quite off, but I might be missing here.
Another option would be to use captus (lit. taken) instead of perditus, but it has maybe more of the connection of being allured or charmed. L&S lists several examples of this kind of usage like (bos) herbā captus viridi. But if the thing taken is rather animum we might find there:
is ut animum eius cura sacrorum et caerimoniarum cepit (Liv.; he, when his care (of .., )'took' his mind).
So we might have: animus cogitatione caputus or even without animus (cogintatione captus)
Basically integrating animus in the phrase might open some options for us, consider for example this quote from Plinus:
Volō tibi multa alia scrībere, sed tōtus animus in hāc ūnā contemplātiōne dēfixus est (I want to write to you more, but my all being is attached to this one contemplation).
I think it makes good candidate for one who is focused on the thought.