Ainsworth, 37, missed the 2-2 draw at Oxford last Saturday with a hamstring injury and is struggling to be fit for the visit of the Cobblers.
However, manager Gary Waddock has a ready-made replacement available as fellow midfielder Matt Bloomfield is back in full training after a groin injury.
Veteran defender Chris Westwood returned from a groin strain as a substitute last time out while striker Stuart Beavon - whose father Stuart played for the Cobblers in the 1990s - was replaced during the first half at Oxford with a knee injury but is available.
Left-back Andy Sandell is fit again after a knee problem but midfielder Stuart Lewis has been ruled out for up to three weeks with ankle ligament damage.
Source: PA
Source: PA