Husk, 1818 17 bytes
#oṗḋuż+m`:1oΘḣḋ¹ṫḋ#oṗḋużoJ1eḣḋ¹mtṫḋ
Different approach to Razetime's Husk answer, saving 22 3 bytes.
How?
#oṗḋuż+m`:1oΘḣḋ¹ṫḋ#oṗḋużoJ1eḣḋ¹mtṫḋ
#o # how many
ṗ # prime numbers
ḋ # among numbers formed by binary digits of
u # unique elements of
ż+żo # zip together 2 lists:
of lists,
m`:1oΘḣḋ¹ J1e # list 1:
# joining each pair with the ḣdigit '1'
# allḣḋ¹ prefixes of
# list 1:
ḋ¹ ḣ # binary digits of input
# all prefixes of oΘ
#ḋ¹ prefixed by an empty list
# m`:1binary digits of input
# with 1 addedmtṫḋ at the end of each # list 2:
mt ṫḋ # listremove 2:
first element from
ṫ # all suffixes of
ḋ # binary digits of input