Huailing liukou shizhong lu 懷陵流寇始終錄 "All about the roaming bandits of Huailing" is an unofficial history of the numerous uprising against the Ming dynasty 明 (1368-1644) in the early 17th century. It is also known with the titles Koushi biannian 寇事編年 "The annals of the bandit affairs", Liukou changbian 流寇長編 "Long account on the roaming bandits" or Liukou biannian 流寇編年. It was written by Dai Li 戴笠 (1614-1682) and revised and shortened by Wu Shu 吳殳 (1610-1694).
Dai Li retired after the demise of the Ming, earned some money as a private teacher and compiled a lot of books, among other Xunguo huibian 殉國彙編 "Collected [essays] about the downfall of Our Dynasty", Guxianglu 骨香錄 "The scent of bones", Qijiuji 耆舊集, Faqianlu 發潛錄 and Yongling zhuanxin lu 永陵傳信錄, all dealing with the history of the Ming dynasty.
Wu Shu was also interested in history and compiled Fuyinlu 撫膺錄, Weilu shihua 圍爐詩話 and Shilun 史論. During the first years of the Qing period 清 (1644-1911) Dai Li started compiling a history covering the last years of Ming when the empire was shaken by several uprisings. In connection with Pan Shuzhang 潘樹章 and Wu Yan 吳炎 (1624-1663) who started with the compilation of a dynastic history of the Ming with the planned title Mingshiji 明史記, Dai's book was planned to serve as the last part of this history. The compilation of this book was then prohibited because several of the compilers belonged to the party advocating the reinstalment of the Ming dynasty. Dai Li nevertheless continued to write his book Liukouzhi.
After Dai Li's death in 1682 his writings were cared for by his disciple Pan Lei 潘耒 (1646-1708) who handed the Liukouzhi over to Wu Shu who finally created the common version in 18 juan. There are, nevertheless, several manuscript copies which differ in content and length.
The common version has an appendix of two chapters called Jiashen shengshi 甲申剩事 and Jiangwang yaonie 將亡妖孽. It is furthermore enriched with a biography of Dai Li written by Tan Jicong 譚吉璁 (1623-1679) and several prefaces, tables and overview. The Liukouzhi covers the time from 1627 to 1664 and describes the many uprisings against the Ming government in detail, thanks to the many different official, archival and private sources Dai Li had used. A commentary is added to the main text.
The first print was published when the Liukou zhi was incorporated into the second series of the reprint series Xuanlantang congshu 玄覽堂叢書續集 in 1947. Probably influenced by Dai Li's book, the official dynastic history Mingshi 明史 contains a collective biography about the uprisings at the end of the Ming period (309 Liuzei zhuan 流賊傳).