During the medieval period, shakuhachi were most notable for their role in the Fuke sect of Zen Buddhist monks, known as komuso ("priests of nothingness," or "emptiness monks"), who used the shakuhachi as a spiritual tool. Their songs (called "honkyoku") were paced according to the players' breathing and were considered meditation as much as music.
Travel around Japan was restricted by the shogunate at this time, but the Fuke sect managed to wrangle an exemption from the Shogun, since their spiritual practice required them to move from place to place playing the shakuhachi and begging for alms (one famous song reflects this mendicant tradition, "Hi fu mi, hachi gaeshi", "One two three, pass the alms bowl"). They persuaded the Shogun to give them "exclusive rights" to play the instrument. In return, some were required to spy for the shogunate, and the Shogun sent several of his own spies out in the guise of Fuke monks as well. This was made easier by the wicker baskets that the Fuke wore over their heads, a symbol of their detachment from the world.
In response to these developments, several particularly difficult honkyoku pieces, for example, Shika no tone, became well-known as "tests": if you could play them, you were a real Fuke. If you couldn't, you were probably a spy and might very well be killed if you were in unfriendly territory.
With the Meiji Restoration, beginning in 1868, the shogunate was abolished and so was the Fuke sect, in order to help identify and eliminate the shogun's holdouts. The very playing of the shakuhachi was officially forbidden for a few years. Non-Fuke folk traditions did not suffer greatly from this, since the tunes could be played just as easily on another pentatonic instrument. However, the honkyoku repertoire was known exclusively to the Fuke sect and transmitted by repetition and practice, and much of it was lost, along with many important documents.
When the Meiji government did permit the playing of shakuhachi again, it was only as an accompanying instrument to the koto or shamisen. It was not until later that honkyoku were allowed to be played publicly again as solo pieces.