I saw a shadow fumbling inside my closet. [...] , I screamed.
I thought of the word confused but I think it doesn't have enough intensity. Is there a word/phrase that means uncertain of what was going on?
Bewildered might do the trick:
I saw a shadow fumbling inside my closet. Bewildered, I screamed.
Personally, I would use a word more synonymous to scared in this sentence, although I don't know what precedes it. Alarmed would most likely work as well.
The phrase put on edge implies intensity, and would fit in nicely.
I saw a shadow fumbling inside my closet. Suddenly put on edge, I screamed.
Horrified would emphasize the fear factor more, while
Clueless would emphasize the unawareness/uncertainty more.
Although it may not be the best fit for "uncertain of what was going on," I think startled fits perfectly within the context of the sentence you include in your question:
startle: to do something unexpected that surprises and sometimes worries a person or animal.
I saw a shadow fumbling inside my closet. Startled, I screamed.
confused, muddled, addled, bewildered, disoriented, fazed, perplexed, dazed, dizzy, stupefied, groggy, muzzy, foggy, fuddled, fuzzy, dopey, woozy, befogged, mixed up
Perhaps "spooked [out]", "unnerved", or "freaked [out]"?
spook: frighten; unnerve: they spooked a couple of grizzly bears.
[ no obj. ] (especially of an animal) take fright suddenly: he'll spook if we make any noise.
unnerve: make (someone) lose courage or confidence: the bleakness of his gaze unnerved her | (as adj. unnerving) : an unnerving experience.
freak: informal behave or cause to behave in a wild and irrational way, typically because of the effects of extreme emotion, mental illness, or drugs: [ no obj. ] : I could have freaked out and started smashing the place up | [ with obj. ] : he freaks guest stars out on show day.
Unbeknownst! Unbeknownst to me, they had already left.. Works perfectly.