Adams was in his second spell as a Bury player and had played regularly as the Shakers won promotion to League One in the season just ended.
The midfielder was told last week, however, that he was free to talk to other clubs about a move this summer and the Cobblers have moved quickly to seal a deal.
"I was shocked, to be honest, because I had a good season," said the 28-year-old of his Gigg Lane exit.
"I played 90 per cent of the games but they said they're going in a different direction next year, so I've got to repsect that."