Even preceding Cao Cao's death, Sima Yi was a close confidante of his successor, Cao Pi.
In 225, Cao Pi advanced against the rival state of Eastern Wu, and entrusted Sima Yi with command over the capital in his absence.