The Wiltshire Family History Society has published a helpful research tool called “Goodies & Baddies, 1722-1820.” This is an index for the Calendars of Prisoners in the Wiltshire Quarter Sessions and includes not only the prisoners (baddies), but also the victims, witnesses, and court officials (goodies). This index is available at the Wiltshire and Swindon History Centre in Chippenham and at the Calne and Chipphenham Libraries, but the original record can only be viewed at the History Centre.
An example of what you might find is the entry for John Purnell and George Davis who were sentenced to “be severally imprisoned in the House of Correction at Devizes for nine calendar months to hard labour and to be once privately whipt in the first month and once in the last week of their confinement.” They were “Committed by W.E. Waldron, esq., charged on the oaths of Charles Rogers, with having feloniously stolen from the dwelling house of the said Charles Rogers, an alarum clock his property, at Trowbridge. Warrant dated Oct. 25, 1828.” The article “Devizes Prison” on the centre’s website stated that “…all sentences were punished with hard labour which consisted of the tread wheel.” Visit the Wiltshire and Swindon History Centre’s blog on their website to read more about life in Devizes Prison as it may relate to your ancestor!