Statistics for occurrence #1 of “James River” in chapter 5.27 of Robert Underwood Johnson, Clarence Clough Buell, Battles and Leaders of the Civil War: Volume 2.:
...boats rendered efficient assistance to the army, especially in the battle at Malvern Hill on the 1st of July.
By the 4th of July, McClellan's position was comparatively secure.
On July 6th, the James River flotilla was organized as a separate command under Captain John Wilkes, and so remained, until disbanded, on August 31st, the withdrawal of the army rendering its presence no longer necessary.
...