At a writing forum I hang out at, Quora if you are interested, a newbie asked if writers put foreshadowing in while we are writing or when we are editing. The answer is both, of course, but I have found as I start editing my books that I have added foreshadowing of things I wasn't even aware that I was going to do until I did them. My subconscious knew that an important thematic and plot element was the darker self, and there were images and metaphors of mirrors, shadows, moonlight, and twins sprinkled from the first page.
All this to say aren't we all writers long before we know we are, and the writer in our brain has been busy taking notes? Yeah, now I've stopped everyone here who decided to write late in life to consider that question.
From the first bedtime stories my dad invented on the spot, I always wanted to be a writer, and stories were flowing through my mind, but putting them on paper as a book was some day, not right now, while I'm worked on my college degrees in literary analysis and teaching.
When I finally started putting it on paper, I realized that many of those long analysis papers I wrote were as much about figuring out how to create the stories I wanted to write as figuring out the metaphoric structure of a novel by James Fenimore Cooper.
So, I’ve always been a writer and a reader, plus a writing teacher, and my subconscious has known my whole life. How about you?