Saga Rebellion painting by Tsukioka Yoshitoshi 1839 to 1892...
It was around the beginning of the Tokugawa period also know as the Edo period when the capital was moved from Kyoto to Edo (modern day Tokyo) 1603 to 1868. The Tokugawa Shogunate/Period was founded by Tokugawa Ieyasu who was a loyal retainer of Oda Obunaga. I just remember the 3 major periods for ninjutsu & martial arts as Sengoku (Warring States Period): when most of the wars and fighting occured, Tokugawa Period (relative peace and isolationism): this is when the classes became lock and Ashigaru went from being conscripts and other classes who became part of the warrior caste to being considered low level samurai & the Meiji Restoration (marked the end of feudalism and when Japan was opened to the west).
Whats funny about the Meiji and it meant the end of the samurai class and there were numerous uprisings by Samurai against Japanese "colonialism." The Samurai of the Fukuoka Domain established a very ninja like secret society called the Koyosha, that became the Genyosha after the Satsuma Rebellion. The Koyosha worked to build secret alliances, gather information, smuggle supplies and carried out assassinations, sabotage and terrorism during the various samurai uprisings. All very ninja and carry out by former samurai. Which raises certain questions, if ninjutsu was a stand alone system why were samurai of the peaceful Tokugawa Period using "ninjutsu" skills to resist the Meiji Restoration? What if ninjutsu isn't the exclusive art of specific family schools of ninjutsu but a sub-set of skills in samurai ryu? If so many samurai ryu had ninjutsu in them, why did ninjutsu become such a lost art? Was it such a lost art if the Samurai of the Fukuoka Domain seems to have used it in the formation and operation of Koyosha? Then if ex-samurai resisted the end of their cast system using a secret society (clandestine network) and very "ninjutsu" like methods can we say the "end of the ninja" in Tokugawa Period was an end to their use and not to the study?
If ninjutsu was a sub-set of skills in various samurai ryu and not an exclusion school/style of thinking, then there never were "ninja warriors" only samurai with training in covert and clandestine operations. More so, it is possible for "ninjutsu" to have survived in some form and its seems to have done so up to the Meiji period and beyond by looking at groups like the Koyosha, Genyosha and Kokuryukai. This is an element addressed by Turnbull's article and articles various other people. Especially, looking at historical records where "shinobi" was used pretty loosely even for the Ashigaru sent on scouting missions, but little formal training in a samurai ryuha. More so, other terms were used for spies and scouts in said records then "shinobi."
So lets look at the "ninja" and use a different term, "samurai." Tokugawa's era mark the end of the warring states period, it meant samurai became more government agents then warriors. Without the need to actually use covert and clandestine tactics and strategies they became openly discussed and the modern "ninja myth" was born. Certainly, the Tokugawa Period meant that many samurai never faced combat or warfare in the later years of the period. Certainly, stories of father's exploits during the Sengoku period, became grandfather's exploits and great grandfather's exploits and eventually your ancestor "__fill in the blank__" with the passage of time. The Tokugawa period lasted 200+ years and the end of ninja's usefulness in warfare ended with the samurai's usefulness in warfare.
By comparing this to American History, the Colonial Era prior to the American Revolution produced Roger's Rangers covert skirmishers, and clandestine scouts. This was added to by various periods of Western Expansion and adding and altering the tactics and techniques of the "Ranger Docturine" disappeared between American Revolution and the Civil War. However, it should be noted Rogers Rangers fought for the Loyalists and the American Colonial Army used Roger's doctrine to create Knowlton's Ranger The Ranger's disappeared until the Civil War and only the Confederacy used said Ranger Doctrine, due to the fact that many Confederate officers were trained at West Point where they studied Roger's Ranger Doctrine and their use actually prompted the creation of only one Union Army Ranger unit: Mean's Rangers. Rangers were never used again until World War 2 and were used in the "fashion of British Commandos" however it should be noted the US Army Rangers still trace themselves to Roger's "Ranger Doctrine" which was studied and applied. Even the Alamo Scouts founded in World War 2, trace elements of their doctrine to Roger's Rangers with additions of more modern intelligence gathering & combat skills. I've read this was a direct response the operations of Japanese Nakano operatives and Kokuryukai, formed by Uchida Ryohei in 1901 who was a protege of Toyama Mitsuru a founder of the Koyosha & Genyosha and who fought in the Saga Rebellion.
Now I'm not suggesting the Kokuryukai had ninja... I am however addressing even in more modern history, principles of doctrines do not just vanish because a line of transmission of disrupted. Most Samurai Ryu existed from the Sengoku period, through the Tokugawa period where they had little usage due to that long period of peace to the Meiji Period (1868). I do not believe the Samurai just stopped studying warfare because of peace, they were the Warrior caste after all. Doctrines change with technology and situations by which they are employed. I do not believe human nature is so different just because of cultural differences. And I do not believe "ninjutsu" was a stand alone art practiced by specific schools. I believe it is a lesser skill studied by certain members of Japan's warrior caste, not only limited to the samurai but most connected to the samurai because of the status as "governors and officers" to the Shogunate. I'll let you assess your own opinions.