Green’s Dictionary of Slang

counter-rat n.

[SE counter, a (debtor’s) prison + SE rat]

1. an inferior officer of a debtor’s prison.

[UK]T. Overbury New and Choise Characters n.p.: His Yeoman is the Hangar that a sargeant weares by his side [...] This counter-rat hath a tayle as long as his fellowes, but [...] hath not his full halfe share of the booty.
[UK]R. Speed Counter-Rat E1: No, these are no Rats with foure legs, but only two; [...] they run but into two Rat-traps, that’s to say, The Compters of Wood-street and the Poultry, and for that cause are called Compter-Rats.
[UK]H. Glapthorne Wit in a Constable V i: They’le take him for a Rat ith’ Counter.

2. a criminal inmate of a debtor’s prison.

[UK]N. Ward Hudibras Redivivus II:6 8: In piss-burnt Wigs, and flapping Hats, / Looking as rough as Counter Rats.