I've briefly touched on this subject before, but as it remains a strong feature of what I do, I'm strongly drawn to analyse what is happening and try to make some sense of it. I refer to Deja Vu - yes I know - we've been there before! (Sorry about that, I couldn't resist it) More seriously, this phenomenon has cost me no little time and effort because of the nature and frequency of it's occurences. Whether it's writing a short essay, article or even lines of code, I sometimes have to stop myself and ask the question: "Haven't I already done this?" If I shrug the 'feeling' off, and carry on with writing, I'm again later interrupted by an even stronger conviction that I've already completed or near-completed the work already. At this point I usually have to check the relevant directories on the hard disk for evidence of this conviction, but have never (yet) found any. This is most frustrating, and I suppose it's a little like an OCD-sufferer returning to his door over and over again to ensure that he locked it.
Now what I do know is that the problem is closely allied to the way I work, or have worked in the past. Usually, when I sit down to write anything (this for example) I've already made up my mind exactly what to say, and the writing is a fairly obvious (and mundane) repetition of stuff I have already gone over several times mentally. I suppose the root cause of the problem is that my brain refuses to believe the plain truth that no amount of mental effort will actually put the words on paper. A lot of what I do is considered/concocted during sleepless nights and/or affected by severe mood-swings, so reality gets somewhat bent on occasions.
The obsessive part I believe comes from my background in programming. Early on, I was taught several bitter lessons about 'losing' code. The unhappy events meant re-writing everything that had taken maybe several weeks of effort. One such occasion made an important 'fact' (or more honestly 'belief') become apparent - I never was able to write the replacement code exactly the way I had done it the first time, and I know this because on that specific occasion only, I came across my 'lost' code on a cassette (ah happy days!) that had fallen behind the desk I used. When I compared this with my latter effort, it was significantly different - not in it's function, but in its implementation. I examined both sets of code, and decided that the 1st (lost) version was definitely better than its replacement. So it seems that this one event has coloured my cognitive processes, and it is simple paranoia that makes me search in vain for work I imagine I've already done, as of course, my 'lost' work will naturally be 'better'.
This is almost laughable looking at it in retrospect, and the simple recollection of the original event that possibly caused the paranoia will make it a lot easier to deal with in future.
There is a lesson here for those that would accuse others of 'dwelling' on the past, as if it were a 'bad' thing. What we are now is because of what we did or what was done to us then. An understanding of the relevant triggers, and correcting our emotional responses to these, may necessitate a rigorous examination of our past. Unfortunately, a large part of the 'programming' in our heads remains hidden - like orphaned files on a crashed hard disk, and requires expert help and guidance, and a large amount of effort on our part also, to reveal its structure and content.
CBT (Cognitive Behaviour Therapy) is the current 'buzz' and apparently a solution to almost everything, if we believed it's pundits. My opinion is that it barely scrapes the surface, and in truth the quality of so-called CBT therapists, despite their fancy certificates, mandates that they are incapable of giving real help to someone who badly needs it. For an understanding of how your mind works, and what you can do about re-programming some of it's gliches, I recommend you to buy a good book on NLP. (Neuro-Linguistic Programming)