The 33-year-old has agreed a two-year deal at Sixfields and will join the Cobblers on July 1 when his contract at Rovers expires.
Lines becomes the third new signing made by Northampton already ahead of next season and manager Keith Curle thinks his know-how will prove valuable.
"I think his attributes will really help us. He has a lot of experience and he also has a lot of quality on the ball and can help to unlock defences. He is a very cultured player," Curle told the club's official website.
"He is a midfielder who can create chances and set things up. He also has a quality set-play delivery.
"With a number of young players in the squad, we will need our share of experience for those players to look up to and Chris is ideal to fit that bill. He has won promotion four times in his career, he knows what is required and he is hungry for more success.
"Chris has a first-class work ethic and attitude, I think he will prove an excellent addition and he very much fits in with the culture we will have within the squad next season
Bore Draw Money Back: Refund for any Soccer game that finishes 0-0 at bet365. Applies to losing pre-match bets on any Correct Score, Half-Time/Full-Time or Scorecast markets. Bet restrictions and T&Cs apply. New and eligible customers only.