Write with the door closed. Once ideas are formed independently, rewrite with the door open to gather feedback.
When writing my article "Remove Labels", I have this question of when I should solicit feedback. Getting feedback too early can distract and diverge my thoughts, while waiting too long makes it hard to fix critical writing flaws.
Then I read this from Stephen King:
"Write with the door closed, rewrite with the door open. Your stuff starts out being just for you, in other words, but then it goes out. Once you know what the story is and get it right — as right as you can, anyway — it belongs to anyone who wants to read it. Or criticize it."
The optimal time for feedback seems to be once I've distilled my primary thesis and conclusion with a flexible outline. Such timing enables me to form ideas independently first while I can still comfortably fix critical flaws based on feedback.
"Write with the door closed, rewrite with the door open" also reminds me of Beer Mode and Coffee Mode. On any given day, coffee mode, a state of focus where we try to get things done, lets us be more productive. But over the long arc of time, beer mode, an unfocused state where we try to discover new ideas, rewards serendipity, and intellectual breakthroughs.