The move comes just days after Virat Kohli decided to step down as India's Twenty20I captain following the 20-overs World Cup beginning next month, and Shastri reckoned it would be the right time for him to step aside as well.
"I believe so because I've achieved all I wanted," the former test player told the Guardian newspaper.
"Five years as No. 1 (in test cricket), to win in Australia twice, to win in England."
"We've also beaten every country in the world in their own backyard in white-ball cricket. If we win the World Cup, it will be the icing on the cake."
"I believe one thing – never overstay your welcome. And I would say that, in terms of what I wanted to get out of the side, I've over-achieved."
India led the five-test series in England heading into the final match in Manchester which was called off after Covid-19 cases in the touring camp.
Shastri himself contracted the virus and could not accompany the team to Manchester where a fourth member of the support staff tested positive, prompting the match to be cancelled.
Shastri came under fire for holding a book launch at a party in London where guests were seen without masks, but the former all-rounder brushed off the criticism.
"I've not got it at my book launch," he said.
"I have absolutely no regrets because the people I met at that function were fabulous. And it was good for the boys to get out and meet different people rather than constantly being in their rooms."