Douglas Hofstadter mentions in his book Gödel, Escher, Bach (GEB) something similar which he calls strange loops. He actually wrote another book that focuses on this concept. It’s called I Am a Strange Loop:
According to Hofstadter, strange loops take form in human consciousness as the complexity of active symbols in the brain inevitably leads to the same kind of self-reference which Gödel proved was inherent in any sufficiently complex logical or arithmetical system (that allows for arithmetic by means of the Peano axioms) in his incompleteness theorem. Gödel showed that mathematics and logic contain strange loops: propositions that not only refer to mathematical and logical truths, but also to the symbol systems expressing those truths. This leads to the sort of paradoxes seen in statements such as "This statement is false," wherein the sentence's basis of truth is found in referring to itself and its assertion, causing a logical paradox.
Hofstadter argues that the psychological self arises out of a similar kind of paradox. The brain is not born with an "I" – the ego emerges only gradually as experience shapes the brain's dense web of active symbols into a tapestry rich and complex enough to begin twisting back upon itself. According to this view, the psychological "I" is a narrative fiction, something created only from intake of symbolic data and the brain's ability to create stories about itself from that data. The consequence is that a self-perspective is a culmination of a unique pattern of symbolic activity in the brain, which suggests that the pattern of symbolic activity that makes identity, that constitutes subjectivity, can be replicated within the brains of others, and likely even in artificial brains.