Stream of Thought is still on the stack while you choose cards in your graveyard to shuffle into your library. It can’t shuffle itself into your library.

Artwork
Loading artwork…
Stream of Thought
The List · #MH1-71 · EN
Nonfoil—Foil—
Card rules
Target player mills four cards. You shuffle up to four cards from your graveyard into your library.
Replicate 2
(When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.)
Common · Illustrated by Seb McKinnon
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
You choose which cards to shuffle into your library while Stream of Thought is resolving. If you target yourself with Stream of Thought, you may choose any of the four cards that you put into your graveyard or any cards that were there before.
If you replicate Stream of Thought, the copies resolve before the original spell, so they can’t shuffle Stream of Thought into your library.
You’ll copy Stream of Thought for each time you paid its replicate cost, even if it’s countered.
The copies that replicate creates are created on the stack, so they’re not “cast.” Abilities that trigger when a player casts a spell won’t trigger.