General McClellan did not direct his army during the battle.
George Brinton McClellan (December 3, 1826 – October 29, 1885) was an American soldier, Civil War Union general, civil engineer, railroad executive, and politician who served as the 24th governor of New Jersey. When McClellan decided to withdraw, the Confederate commander seemed to relinquish all responsibility for managing his troops while they struggled to deal with Lee's relentless advance. He spent most of June 30 aboard the gunboat Galena while the Army of the Potomac averted disaster at Glendale. General McClellan is one of the figures contributing to the success of the list of facts about the Battle of Malvern Hill.
While General McClellan was on the field for most of the Battle of Malvern Hill, his role wasn't much more active than it once was. At dawn on July 1, McClellan met with his favorite subordinate, General Fitz John Porter to discuss the disposition of his troops, before once again retreating to Galena, presumably in preparation for the army's supply base at Harrison's Landing. The commanding general returned to the battlefield afterward but was content to let Porter and his other corps commanders manage the battle on their own. Unlike the previous day's battle, however, McClellan's subordinates had a clear view of the battle plan, and with Porter being the de facto commander of the army, Napoleon the Younger could rest assured that the plan was will be performed.